From 73a3bc3bbc5296775a21e6b6065c5164a9ea561d Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 23 Jul 2024 11:31:31 +0200 Subject: [PATCH] MOBILE-4616 autologout: Fix database cleanup --- src/core/features/autologout/services/autologout.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/features/autologout/services/autologout.ts b/src/core/features/autologout/services/autologout.ts index d7877c90d..498efa3df 100644 --- a/src/core/features/autologout/services/autologout.ts +++ b/src/core/features/autologout/services/autologout.ts @@ -52,10 +52,12 @@ export class CoreAutoLogoutService { */ initialize(): void { CoreEvents.on(CoreEvents.LOGIN, async() => await this.refreshListeners()); - CoreEvents.on(CoreEvents.LOGOUT, async() => { + CoreEvents.on(CoreEvents.LOGOUT, async({ siteId }) => { this.cancelListeners(); - const storage = CoreStorage.forCurrentSite(); - await storage.remove(CoreAutoLogoutService.TIMESTAMP_DB_KEY); + + const site = await CoreSites.getSite(siteId); + + await CoreStorage.forSite(site).remove(CoreAutoLogoutService.TIMESTAMP_DB_KEY); }); }