Skip to content

Commit

Permalink
Fix/email loading (#1912)
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvoskamp authored Feb 13, 2024
1 parent f40e6d1 commit 5ae6766
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/wagmi/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,14 @@ export class Web3Modal extends Web3ModalScaffold {
) {
if (typeof window !== 'undefined' && connector) {
super.setLoading(true)

const provider = (await connector.getProvider()) as W3mFrameProvider
const isLoginEmailUsed = provider.getLoginEmailUsed()
super.setLoading(isLoginEmailUsed)
if (isLoginEmailUsed) {
this.setIsConnected(false)
}

provider.onRpcRequest(request => {
if (!W3mFrameHelpers.checkIfRequestIsAllowed(request)) {
super.open({ view: 'ApproveTransaction' })
Expand All @@ -396,6 +401,7 @@ export class Web3Modal extends Web3ModalScaffold {
super.close()
})
provider.onIsConnected(() => {
this.setIsConnected(true)
super.setLoading(false)
})
}
Expand Down

0 comments on commit 5ae6766

Please sign in to comment.