Skip to content

Commit

Permalink
Reject context when user closes modal
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiSugiura committed Jun 17, 2024
1 parent 32e162f commit 955a60c
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 955a60c

Please sign in to comment.