@@ -49,6 +49,7 @@ export const listenOnce = (
49
49
try {
50
50
remove = await callback ( data ) ;
51
51
} catch ( error ) {
52
+ console . error ( error ) ;
52
53
remove = true ;
53
54
}
54
55
@@ -57,7 +58,6 @@ export const listenOnce = (
57
58
removeEventListener ?. call ( worker , 'message' , listener as any ) ;
58
59
}
59
60
} ;
60
-
61
61
// eslint-disable-next-line @typescript-eslint/no-explicit-any
62
62
addEventListener ?. call ( worker , 'message' , listener as any ) ;
63
63
} ;
@@ -126,6 +126,7 @@ export const connectClientAndProvider = async (
126
126
chainId : 'other' ,
127
127
rpcTarget : 'other' ,
128
128
displayName : 'other' ,
129
+ blockExplorer : 'other' ,
129
130
ticker : 'other' ,
130
131
tickerName : 'other' ,
131
132
...options . client . chainConfig ,
@@ -170,12 +171,25 @@ export const connectClientAndProvider = async (
170
171
171
172
let provider = client . connected ? client . provider : null ;
172
173
if ( ! client . connected && ! dontAttemptLogin ) {
173
- const loginHint = options . getLoginHint ?.( ) ;
174
-
175
- provider = await client . connectTo ( WALLET_ADAPTERS . OPENLOGIN , {
176
- loginProvider : options . loginProvider ,
177
- login_hint : loginHint ,
178
- } as OpenloginLoginParams ) ;
174
+ try {
175
+ const loginHint = options . getLoginHint ?.( ) ;
176
+ provider = await client . connectTo ( WALLET_ADAPTERS . OPENLOGIN , {
177
+ loginProvider : options . loginProvider ,
178
+ login_hint : loginHint ,
179
+ } as OpenloginLoginParams ) ;
180
+ } catch ( err ) {
181
+ // Unnecessary error thrown during redirect, so log and ignore it.
182
+ if (
183
+ usingRedirect &&
184
+ err instanceof Error &&
185
+ err . message . includes ( 'null' )
186
+ ) {
187
+ console . error ( err ) ;
188
+ } else {
189
+ // Rethrow all other relevant errors.
190
+ throw err ;
191
+ }
192
+ }
179
193
}
180
194
181
195
if ( usingRedirect ) {
0 commit comments