Skip to content

Commit

Permalink
fixed a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yashgo0018 committed May 16, 2024
1 parent 9faef19 commit 2ed310d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/nextjs/contexts/AuthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ export default function AuthContextProvider({ children }: { children: React.Reac
if (!address) return;

(async () => {
const signature = await signMessageAsync();
const userKeyPair = new Keypair(new PrivKey(signature));
setKeyPair(userKeyPair);
try {
const signature = await signMessageAsync();
const userKeyPair = new Keypair(new PrivKey(signature));
setKeyPair(userKeyPair);
} catch (err) {
console.error(err);
}
})();
}, [address, signMessageAsync]);

Expand Down

0 comments on commit 2ed310d

Please sign in to comment.