Skip to content

Commit

Permalink
wait for eth_requestAccounts
Browse files Browse the repository at this point in the history
  • Loading branch information
neekolas committed Sep 5, 2023
1 parent 46ecc80 commit 783ae7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/site/src/utils/metamask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 783ae7a

Please sign in to comment.