File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed
Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -279,22 +279,14 @@ export class MetamaskConnectEVM {
279279 forceRequest,
280280 } ) ;
281281
282- // If account is already available, proceed immediately
283- if ( this . #provider. selectedAccount ) {
284- const resolvedParams =
285- typeof params === 'function'
286- ? params ( this . #provider. selectedAccount )
287- : params ;
288- return await this . #provider. request ( {
289- method,
290- params : resolvedParams ,
291- } ) ;
292- }
293-
294- // Otherwise, wait for the accountsChanged event to be triggered
295282 // This is only needed for methods that require an account
296283 const timeout = 5000 ;
297284 const accountPromise = new Promise < Address > ( ( resolve , reject ) => {
285+ // If account is already available, proceed immediately
286+ if ( this . #provider. selectedAccount ) {
287+ return this . #provider. selectedAccount ;
288+ }
289+ // Otherwise, wait for the accountsChanged event to be triggered
298290 // eslint-disable-next-line prefer-const
299291 let timeoutId : ReturnType < typeof setTimeout > ;
300292
You can’t perform that action at this time.
0 commit comments