diff --git a/package-lock.json b/package-lock.json index 954d37ff0b..cc552dd368 100644 --- a/package-lock.json +++ b/package-lock.json @@ -95,6 +95,7 @@ "valtio": "1.11.2" }, "devDependencies": { + "@mailsac/api": "1.0.5", "@playwright/test": "1.40.1", "dotenv": "16.3.1", "ethers": "6.9.0" @@ -5838,6 +5839,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/@mailsac/api/-/api-1.0.5.tgz", "integrity": "sha512-EbqJun6pMCMlDpEY5VmsAlhMJ/ZjofQBUM2TX4p6IKFGaJ3oMBXSbFURu07gXCRRGE97CDUULixww7MoREpx9A==", + "dev": true, "dependencies": { "axios": "^1.6.0" } @@ -13082,6 +13084,7 @@ "version": "1.6.3", "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.3.tgz", "integrity": "sha512-fWyNdeawGam70jXSVlKl+SUNVcL6j6W79CuSIPfi6HnDUmSCH6gyUys/HrqHeA/wU0Az41rRgean494d0Jb+ww==", + "dev": true, "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", diff --git a/packages/ethers/src/client.ts b/packages/ethers/src/client.ts index 5b228cbc4a..0a33767b4f 100644 --- a/packages/ethers/src/client.ts +++ b/packages/ethers/src/client.ts @@ -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) @@ -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) } } }