Skip to content

Commit

Permalink
Reject context when user closes modal (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiSugiura authored Jun 17, 2024
1 parent 32e162f commit 6281ce2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/keychain/src/hooks/connection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 6281ce2

Please sign in to comment.