Skip to content

Commit

Permalink
fix: Add wait before requesting a signature (#96)
Browse files Browse the repository at this point in the history
* fix: Add await

* fix: Update wait time
  • Loading branch information
fzavalia authored Feb 14, 2024
1 parent 51766c3 commit 8819962
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/Pages/LoginPage/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ export const LoginPage = () => {
setConnectionModalState(ConnectionModalState.CONNECTING_WALLET)
const connectionData = await connectToProvider(connectionType)

// Wait a second after the connection is established so there is no race condition between the readiness
// of the connection and the signature being requested.
// This is necessary for Wallet Connect.
await wait(800)

setConnectionModalState(ConnectionModalState.WAITING_FOR_SIGNATURE)
await getIdentitySignature(connectionData.account?.toLowerCase() ?? '', connectionData.provider)

Expand Down

0 comments on commit 8819962

Please sign in to comment.