Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 1e651bf

Browse files
authored
Clear electron data when logging out (#10386)
1 parent f37ae1e commit 1e651bf

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/BasePlatform.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,4 +442,12 @@ export default abstract class BasePlatform {
442442
logger.error("idbDelete failed in destroyPickleKey", e);
443443
}
444444
}
445+
446+
/**
447+
* Clear app storage, called when logging out to perform data clean up.
448+
*/
449+
public async clearStorage(): Promise<void> {
450+
window.sessionStorage.clear();
451+
window.localStorage.clear();
452+
}
445453
}

src/Lifecycle.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,7 @@ export async function onLoggedOut(): Promise<void> {
862862
stopMatrixClient();
863863
await clearStorage({ deleteEverything: true });
864864
LifecycleCustomisations.onLoggedOutAndStorageCleared?.();
865+
await PlatformPeg.get()?.clearStorage();
865866

866867
// Do this last, so we can make sure all storage has been cleared and all
867868
// customisations got the memo.

0 commit comments

Comments
 (0)