File tree Expand file tree Collapse file tree 5 files changed +6
-3
lines changed
connectors/auth-connector Expand file tree Collapse file tree 5 files changed +6
-3
lines changed Original file line number Diff line number Diff 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 } ;
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ( ) =>
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments