Skip to content

Commit 73e1481

Browse files
fix bugs
1 parent b72e0aa commit 73e1481

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

packages/modal/src/modalManager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
200200
if (!visibility && this.status !== CONNECTOR_STATUS.CONNECTED) {
201201
this.removeListener(CONNECTOR_EVENTS.CONNECTED, handleConnected);
202202
this.removeListener(CONNECTOR_EVENTS.ERRORED, handleError);
203+
this.removeListener(CONNECTOR_EVENTS.AUTHORIZED, handleConnected);
203204
return reject(new Error("User closed the modal"));
204205
}
205206
};

packages/modal/src/react/context/Web3AuthInnerContext.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export function Web3AuthInnerProvider(params: PropsWithChildren<Web3AuthProvider
108108
const disconnectedListener = () => {
109109
setStatus(web3Auth.status);
110110
setIsConnected(false);
111+
setIsAuthorized(false);
111112
setProvider(null);
112113
};
113114
const connectingListener = () => {
@@ -120,6 +121,7 @@ export function Web3AuthInnerProvider(params: PropsWithChildren<Web3AuthProvider
120121
const rehydrationErrorListener = () => {
121122
setStatus(web3Auth.status);
122123
setIsConnected(false);
124+
setIsAuthorized(false);
123125
setProvider(null);
124126
};
125127

packages/modal/src/ui/components/Loader/Loader.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ function Loader(props: LoaderProps) {
141141
handleMobileVerifyConnect,
142142
} = props;
143143

144-
// eslint-disable-next-line no-console
145-
console.log("connectorName", connectorName);
146144

147145
const isConnectedAccordingToAuthenticationMode = useMemo(
148146
() =>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
CHAIN_NAMESPACES,
2929
cloneDeep,
3030
CONNECTED_EVENT_DATA,
31+
CONNECTED_STATUSES,
3132
CONNECTOR_CATEGORY,
3233
CONNECTOR_CATEGORY_TYPE,
3334
CONNECTOR_EVENTS,
@@ -417,7 +418,7 @@ class AuthConnector extends BaseConnector<AuthLoginParams> {
417418
}
418419
// handle disconnect from ws embed
419420
this.wsEmbedInstance?.provider.on("accountsChanged", (accounts: unknown[] = []) => {
420-
if ((accounts as string[]).length === 0 && this.status === CONNECTOR_STATUS.CONNECTED) this.disconnect({ cleanup: false });
421+
if ((accounts as string[]).length === 0 && CONNECTED_STATUSES.includes(this.status)) this.disconnect({ cleanup: false });
421422
});
422423
}
423424
}

packages/no-modal/src/react/context/Web3AuthInnerContext.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export function Web3AuthInnerProvider(params: PropsWithChildren<Web3AuthProvider
102102
const disconnectedListener = () => {
103103
setStatus(web3Auth.status);
104104
setIsConnected(false);
105+
setIsAuthorized(false);
105106
setProvider(null);
106107
};
107108

0 commit comments

Comments
 (0)