Merge pull request #4128 from NoelDeMartin/MOBILE-4616

MOBILE-4616 autologout: Fix database cleanup
main
Alfonso Salces 2024-07-23 12:04:19 +02:00 committed by GitHub
commit a40ce146de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -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);
});
}