diff --git a/kotosoft-id-frontend/app/me/items/applications.tsx b/kotosoft-id-frontend/app/me/items/applications.tsx index 21b260e..49866b7 100644 --- a/kotosoft-id-frontend/app/me/items/applications.tsx +++ b/kotosoft-id-frontend/app/me/items/applications.tsx @@ -11,7 +11,7 @@ import { revokeConsent } from "@/actions/consents"; import { useState } from "react"; interface Props { - consents: Consent[] | []; + consents: Consent[] | null; setConsents: (consents: Consent[]) => void; } @@ -25,7 +25,7 @@ export default function Applications({ consents, setConsents }: Props) { const handleRevoke = async (clientId: string) => { const result = await revokeConsent(clientId); if (result.success) { - const updated = list.filter(c => c.client_id !== clientId); + const updated = list?.filter(c => c.client_id !== clientId) ?? []; setList(updated); setConsents(updated); } @@ -36,7 +36,7 @@ export default function Applications({ consents, setConsents }: Props) {