Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
fix: close sign in modal after login
Browse files Browse the repository at this point in the history
  • Loading branch information
intergalacticspacehighway committed Nov 16, 2023
1 parent d7e112c commit 0528cf5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/app/components/login/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ export function Login() {
}, [showSignMessage, modalScreenContext]);

useEffect(() => {
// pop back to the previous screen if the user is authenticated
if (user.isAuthenticated && !prevUser?.isAuthenticated) {
if (
user.isAuthenticated &&
!prevUser?.isAuthenticated &&
router.asPath === "/login"
) {
router.pop();
}
}, [router, user, prevUser]);
Expand Down Expand Up @@ -84,6 +87,7 @@ export function Login() {
if (privy.authenticated) {
await privy.logout();
}
router.pop();
privy.login();
}}
>
Expand Down

0 comments on commit 0528cf5

Please sign in to comment.