From 955a60c1d75a7b22fc58c0f5b6c3f7ecde76bfe6 Mon Sep 17 00:00:00 2001 From: JunichiSugiura Date: Mon, 17 Jun 2024 18:35:05 +0200 Subject: [PATCH] Reject context when user closes modal --- packages/keychain/src/hooks/connection.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/keychain/src/hooks/connection.tsx b/packages/keychain/src/hooks/connection.tsx index bdc445a92..b584632e4 100644 --- a/packages/keychain/src/hooks/connection.tsx +++ b/packages/keychain/src/hooks/connection.tsx @@ -91,11 +91,12 @@ export function ConnectionProvider({ children }: PropsWithChildren) { if (!parent) return; try { + context.reject("User closed modal"); await parent.close(); } catch (e) { // Always fails for some reason } - }, [parent]); + }, [context, parent]); const logout = useCallback((context: ConnectionCtx) => { setContext({