Skip to content

Commit

Permalink
fix ethers loading hanging state
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvoskamp committed Jan 4, 2024
1 parent 7f4f8c3 commit 49f8b96
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion packages/ethers/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,8 @@ export class Web3Modal extends Web3ModalScaffold {

if (this.emailProvider) {
const { address, chainId } = await this.emailProvider.connect()
super.setLoading(false)
if (address && chainId) {
super.setLoading(false)
EthersStoreUtil.setChainId(chainId)
EthersStoreUtil.setProviderType(ConstantsUtil.EMAIL_CONNECTOR_ID as 'w3mEmail')
EthersStoreUtil.setProvider(this.emailProvider as unknown as CombinedProvider)
Expand Down Expand Up @@ -1032,8 +1032,11 @@ export class Web3Modal extends Web3ModalScaffold {
const isLoginEmailUsed = this.emailProvider.getLoginEmailUsed()
super.setLoading(isLoginEmailUsed)
const isConnected = await this.emailProvider.isConnected()

if (isConnected) {
this.setEmailProvider()
} else {
super.setLoading(false)
}
}
}
Expand Down

0 comments on commit 49f8b96

Please sign in to comment.