Skip to content

Commit 061c235

Browse files
committed
fix issue auth connector disconnecting twice when log out
1 parent fb44546 commit 061c235

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/no-modal/src/base/connector/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export const CONNECTOR_STATUS = {
33
READY: "ready",
44
CONNECTING: "connecting",
55
CONNECTED: "connected",
6+
DISCONNECTING: "disconnecting",
67
DISCONNECTED: "disconnected",
78
ERRORED: "errored",
89
} as const;

packages/no-modal/src/connectors/auth-connector/authConnector.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ class AuthConnector extends BaseConnector<AuthLoginParams> {
215215
async disconnect(options: { cleanup: boolean } = { cleanup: false }): Promise<void> {
216216
if (this.status !== CONNECTOR_STATUS.CONNECTED) throw WalletLoginError.notConnectedError("Not connected with wallet");
217217
if (!this.authInstance) throw WalletInitializationError.notReady("authInstance is not ready");
218+
this.status = CONNECTOR_STATUS.DISCONNECTING;
218219
await this.authInstance.logout();
219220
if (this.wsEmbedInstance) await this.wsEmbedInstance.logout();
220221
if (options.cleanup) {

0 commit comments

Comments
 (0)