From 68aec91f9c1b74d0ed9a09efd54720faaaba7008 Mon Sep 17 00:00:00 2001 From: Petromir Petrov Date: Thu, 13 Feb 2025 13:25:32 +0200 Subject: [PATCH 1/2] fix: closing entry point authorization request window doesn't reject the queued transaction --- src/controllers/main/main.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/controllers/main/main.ts b/src/controllers/main/main.ts index 69bee085a..6a0839dbc 100644 --- a/src/controllers/main/main.ts +++ b/src/controllers/main/main.ts @@ -335,9 +335,9 @@ export class MainController extends EventEmitter { (r) => r.action.kind !== 'calls' ) userRequestsToRejectOnWindowClose.forEach((r) => - r.dappPromise?.reject(ethErrors.provider.userRejectedRequest()) + this.rejectUserRequest(ethErrors.provider.userRejectedRequest().message, r.id) ) - this.userRequests = this.userRequests.filter((r) => r.action.kind === 'calls') + this.userRequestWaitingAccountSwitch = [] this.emitUpdate() } @@ -772,6 +772,10 @@ export class MainController extends EventEmitter { if (!signedMessage) return if (signedMessage.fromActionId === ENTRY_POINT_AUTHORIZATION_REQUEST_ID) { + console.log({ + userRequests: this.userRequests, + actionsQueue: this.actions.actionsQueue + }) const accountOpAction = makeSmartAccountOpAction({ account: this.accounts.accounts.filter((a) => a.addr === signedMessage.accountAddr)[0], networkId: signedMessage.networkId, From 3c8899448ce22b6ea266fad3c8b7e11d355b6981 Mon Sep 17 00:00:00 2001 From: Petromir Petrov Date: Thu, 13 Feb 2025 13:27:23 +0200 Subject: [PATCH 2/2] delete: log in main --- src/controllers/main/main.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/controllers/main/main.ts b/src/controllers/main/main.ts index 6a0839dbc..d9c2bdb9b 100644 --- a/src/controllers/main/main.ts +++ b/src/controllers/main/main.ts @@ -772,10 +772,6 @@ export class MainController extends EventEmitter { if (!signedMessage) return if (signedMessage.fromActionId === ENTRY_POINT_AUTHORIZATION_REQUEST_ID) { - console.log({ - userRequests: this.userRequests, - actionsQueue: this.actions.actionsQueue - }) const accountOpAction = makeSmartAccountOpAction({ account: this.accounts.accounts.filter((a) => a.addr === signedMessage.accountAddr)[0], networkId: signedMessage.networkId,