Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wagmi authConnector connectExternal resolving issue and enable wagmi email tests #2504

Merged
merged 13 commits into from
Jul 8, 2024
Merged
10 changes: 0 additions & 10 deletions apps/laboratory/tests/shared/utils/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ const braveOptions: UseOptions = {
}
}

const EMAIL_BASED_PLATFORM_REGEX =
/(?:email\.spec\.ts|smart-account\.spec\.ts|siwe-email\.spec\.ts|siwe-sa\.spec\.ts|social\.spec\.ts).*$/u

const SOLANA_UNIMPLEMENTED_TESTS_REGEX =
/^(?!.*(?:email\.spec\.ts|siwe\.spec\.ts|canary\.spec\.ts|smart-account\.spec\.ts|social\.spec\.ts|siwe-sa\.spec\.ts|siwe-email\.spec\.ts)).*$/u

Expand All @@ -52,15 +49,8 @@ const customProjectProperties: CustomProjectProperties = {
testIgnore: /(?:social\.spec\.ts).*$/u
},
'Desktop Brave/wagmi': {
testIgnore: EMAIL_BASED_PLATFORM_REGEX,
useOptions: braveOptions
},
'Desktop Chrome/wagmi': {
testIgnore: EMAIL_BASED_PLATFORM_REGEX
tomiir marked this conversation as resolved.
Show resolved Hide resolved
},
'Desktop Firefox/wagmi': {
testIgnore: EMAIL_BASED_PLATFORM_REGEX
},
// Exclude social.spec.ts, email.spec.ts, siwe.spec.ts, and canary.spec.ts from solana, not yet implemented
'Desktop Chrome/solana': {
grep: SOLANA_UNIMPLEMENTED_TESTS_REGEX
Expand Down
1 change: 0 additions & 1 deletion packages/wagmi/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ export class Web3Modal extends Web3ModalScaffold {
this.wagmiConfig = wagmiConfig

this.syncRequestedNetworks([...wagmiConfig.chains])
this.syncConnectors([...wagmiConfig.connectors])
this.initAuthConnectorListeners([...wagmiConfig.connectors])

watchConnectors(this.wagmiConfig, {
Expand Down
6 changes: 5 additions & 1 deletion packages/wallet/src/W3mFrameProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ export class W3mFrameProvider {
})

return new Promise<W3mFrameTypes.Responses['FrameGetUserResponse']>((resolve, reject) => {
this.connectResolver = { resolve, reject }
if (!this.connectResolver) {
this.connectResolver = { resolve, reject }
}
})
}

Expand Down Expand Up @@ -523,12 +525,14 @@ export class W3mFrameProvider {
this.setLastUsedChainId(event.payload.chainId)

this.connectResolver?.resolve(event.payload)
this.connectResolver = undefined
}

private onConnectError(
event: Extract<W3mFrameTypes.FrameEvent, { type: '@w3m-frame/GET_USER_ERROR' }>
) {
this.connectResolver?.reject(event.payload.message)
this.connectResolver = undefined
}

private onConnectSocialSuccess(
Expand Down
Loading