From 33fd7094cac4bb6375a8351047f2cdbc2c748c53 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Mon, 11 Dec 2023 15:19:56 -0500 Subject: [PATCH] Do not early return from logout (#7147) The subsequent path helps to trigger process reload when the active user logs out and the new active is locked. --- apps/browser/src/background/main.background.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index a42f19c228..ec08fef4e2 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -891,17 +891,16 @@ export default class MainBackground { //Needs to be checked before state is cleaned const needStorageReseed = await this.needsStorageReseed(); + const currentUserId = await this.stateService.getUserId(); const newActiveUser = await this.stateService.clean({ userId: userId }); if (newActiveUser != null) { // we have a new active user, do not continue tearing down application await this.switchAccount(newActiveUser as UserId); this.messagingService.send("switchAccountFinish"); - this.messagingService.send("doneLoggingOut", { expired: expired, userId: userId }); - return; } - if (userId == null || userId === (await this.stateService.getUserId())) { + if (userId == null || userId === currentUserId) { this.searchService.clearIndex(); this.messagingService.send("doneLoggingOut", { expired: expired, userId: userId }); }