From 2ed310d9b0ce7a87229d0d8e8561f75dfe9f6585 Mon Sep 17 00:00:00 2001 From: Yash Goyal Date: Thu, 16 May 2024 19:07:25 +0530 Subject: [PATCH] fixed a bug --- packages/nextjs/contexts/AuthContext.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/nextjs/contexts/AuthContext.tsx b/packages/nextjs/contexts/AuthContext.tsx index 03c44cb..5fdd785 100644 --- a/packages/nextjs/contexts/AuthContext.tsx +++ b/packages/nextjs/contexts/AuthContext.tsx @@ -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]);