diff --git a/packages/metamask/src/index.ts b/packages/metamask/src/index.ts index 5141093..04257c9 100644 --- a/packages/metamask/src/index.ts +++ b/packages/metamask/src/index.ts @@ -63,6 +63,12 @@ export class MetaMask extends Connector { }) this.provider.on('disconnect', (error: ProviderRpcError): void => { + // 1013 indicates that MetaMask is attempting to reestablish the connection + // https://github.com/MetaMask/providers/releases/tag/v8.0.0 + if (error.code === 1013) { + console.debug('MetaMask logged connection error 1013: "Try again later"') + return + } this.actions.resetState() this.onError?.(error) })