Skip to content

Commit

Permalink
Provide window.ethereum synchronously
Browse files Browse the repository at this point in the history
This is needed for websites that check the presence of `window.ethereum`
immediately, so we do not have time to load our config asynchronously.
  • Loading branch information
cairomassimo committed Mar 23, 2022
1 parent 80ac97d commit 938ed8c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/window-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ window.tally = new TallyWindowProvider({
window.removeEventListener("message", fn, false),
origin: window.location.origin,
})
// If there are no other wallets around, we set the rules!
// This is needed for websites that immediately check the presence of `window.ethereum`
window.ethereum ??= window.tally

0 comments on commit 938ed8c

Please sign in to comment.