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 @@ -410,22 +410,14 @@ export class MetamaskConnectEVM {
410410 forceRequest,
411411 } ) ;
412412
413- // If account is already available, proceed immediately
414- if ( this . #provider. selectedAccount ) {
415- const resolvedParams =
416- typeof params === 'function'
417- ? params ( this . #provider. selectedAccount )
418- : params ;
419- return await this . #provider. request ( {
420- method,
421- params : resolvedParams ,
422- } ) ;
423- }
424-
425- // Otherwise, wait for the accountsChanged event to be triggered
426413 // This is only needed for methods that require an account
427414 const timeout = 5000 ;
428415 const accountPromise = new Promise < Address > ( ( resolve , reject ) => {
416+ // If account is already available, proceed immediately
417+ if ( this . #provider. selectedAccount ) {
418+ return this . #provider. selectedAccount ;
419+ }
420+ // Otherwise, wait for the accountsChanged event to be triggered
429421 // eslint-disable-next-line prefer-const
430422 let timeoutId : ReturnType < typeof setTimeout > ;
431423
You can’t perform that action at this time.
0 commit comments