diff --git a/src/components/ageAssurance/AgeAssuranceRedirectDialog.tsx b/src/components/ageAssurance/AgeAssuranceRedirectDialog.tsx index 406aaeaff1..f6a842bbdc 100644 --- a/src/components/ageAssurance/AgeAssuranceRedirectDialog.tsx +++ b/src/components/ageAssurance/AgeAssuranceRedirectDialog.tsx @@ -61,10 +61,6 @@ export function AgeAssuranceRedirectDialog() { const {_} = useLingui() const control = useAgeAssuranceRedirectDialogControl() - // Dialog.useAutoOpen(control.control, 1e3) - - // TODO maybe handle invalid DID here - return ( diff --git a/src/lib/hooks/useIntentHandler.ts b/src/lib/hooks/useIntentHandler.ts index 9c2014a8e7..800929830b 100644 --- a/src/lib/hooks/useIntentHandler.ts +++ b/src/lib/hooks/useIntentHandler.ts @@ -27,6 +27,7 @@ export function useIntentHandler() { const verifyEmailIntent = useVerifyEmailIntent() const ageAssuranceRedirectDialogControl = useAgeAssuranceRedirectDialogControl() + const {currentAccount} = useSession() React.useEffect(() => { const handleIncomingURL = (url: string) => { @@ -78,9 +79,11 @@ export function useIntentHandler() { actorDid: params.get('actorDid') ?? undefined, }) - // TODO maybe handle invalid DID here - - if (state) { + if ( + state && + currentAccount && + state.actorDid === currentAccount.did + ) { ageAssuranceRedirectDialogControl.open(state) } return @@ -103,6 +106,7 @@ export function useIntentHandler() { composeIntent, verifyEmailIntent, ageAssuranceRedirectDialogControl, + currentAccount, ]) } @@ -122,7 +126,6 @@ export function useComposeIntent() { videoUri: string | null }) => { if (!hasSession) return - closeAllActiveElements() // Whenever a video URI is present, we don't support adding images right now.