From 783ae7add5cd7a7ca611037dffd2931e7a545f23 Mon Sep 17 00:00:00 2001 From: Nicholas Molnar <65710+neekolas@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:18:57 -0700 Subject: [PATCH] wait for eth_requestAccounts --- packages/site/src/utils/metamask.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/site/src/utils/metamask.ts b/packages/site/src/utils/metamask.ts index 7cc858e..d18c176 100644 --- a/packages/site/src/utils/metamask.ts +++ b/packages/site/src/utils/metamask.ts @@ -19,11 +19,11 @@ export const isFlask = async () => { } }; -export const getSigner = () => { +export const getSigner = async () => { const provider = new ethers.BrowserProvider(window.ethereum); // Request account access if needed - window.ethereum.request({ method: 'eth_requestAccounts' }); + await window.ethereum.request({ method: 'eth_requestAccounts' }); // Getting the signer from provider return provider.getSigner();