Clear electron data when logging out (#10386)
parent
f37ae1e230
commit
1e651bf1a5
|
@ -442,4 +442,12 @@ export default abstract class BasePlatform {
|
||||||
logger.error("idbDelete failed in destroyPickleKey", e);
|
logger.error("idbDelete failed in destroyPickleKey", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear app storage, called when logging out to perform data clean up.
|
||||||
|
*/
|
||||||
|
public async clearStorage(): Promise<void> {
|
||||||
|
window.sessionStorage.clear();
|
||||||
|
window.localStorage.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -862,6 +862,7 @@ export async function onLoggedOut(): Promise<void> {
|
||||||
stopMatrixClient();
|
stopMatrixClient();
|
||||||
await clearStorage({ deleteEverything: true });
|
await clearStorage({ deleteEverything: true });
|
||||||
LifecycleCustomisations.onLoggedOutAndStorageCleared?.();
|
LifecycleCustomisations.onLoggedOutAndStorageCleared?.();
|
||||||
|
await PlatformPeg.get()?.clearStorage();
|
||||||
|
|
||||||
// Do this last, so we can make sure all storage has been cleared and all
|
// Do this last, so we can make sure all storage has been cleared and all
|
||||||
// customisations got the memo.
|
// customisations got the memo.
|
||||||
|
|
Loading…
Reference in New Issue