Skip to content

Commit

Permalink
Fix ethers loading hanging state (#1702)
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvoskamp committed Jan 4, 2024
1 parent 080d222 commit 794224d
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

3 comments on commit 794224d

@vercel
Copy link

@vercel vercel bot commented on 794224d Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 794224d Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 794224d Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.