Skip to content

Commit

Permalink
feat: set up wallet on relogin
Browse files Browse the repository at this point in the history
  • Loading branch information
nattb8 committed May 29, 2024
1 parent fac5145 commit d7c7888
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Assets/Shared/Scripts/UI/MainMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ async void OnEnable()
bool success = await Passport.Instance.Login(useCachedSession: true);
// Update the login flag
SaveManager.Instance.IsLoggedIn = success;
// Set up wallet if successful
if (success)
{
await Passport.Instance.ConnectEvm();
await Passport.Instance.ZkEvmRequestAccounts();
}
} else {
// No saved credentials to re-login the player, reset the login flag
SaveManager.Instance.IsLoggedIn = false;
Expand Down

0 comments on commit d7c7888

Please sign in to comment.