From 0795fef2522478cbd17592aae28d08c03803b6eb Mon Sep 17 00:00:00 2001 From: gbubemismith Date: Thu, 11 Apr 2024 01:29:27 +0100 Subject: [PATCH] fixed issue with clearing search index state --- apps/browser/src/background/main.background.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index bbcb9f96287..92f5a038fbf 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -1171,6 +1171,7 @@ export default class MainBackground { this.vaultTimeoutSettingsService.clear(userId), this.vaultFilterService.clear(), this.biometricStateService.logout(userId), + this.searchService.clearIndex(), /* We intentionally do not clear: * - autofillSettingsService * - badgeSettingsService @@ -1181,13 +1182,8 @@ 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 (userId == null || userId === currentUserId) { - await this.searchService.clearIndex(); - } - await this.stateEventRunnerService.handleEvent("logout", userId); if (newActiveUser != null) {