Clear local storage settings handler cache on logout (#8454)

This commit is contained in:
Michael Telatynski 2022-05-02 03:23:43 +01:00 committed by GitHub
parent 3a245a0cbe
commit 633229ca26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 22 deletions

View file

@ -61,6 +61,7 @@ import { setSentryUser } from "./sentry";
import SdkConfig from "./SdkConfig";
import { DialogOpener } from "./utils/DialogOpener";
import { Action } from "./dispatcher/actions";
import AbstractLocalStorageSettingsHandler from "./settings/handlers/AbstractLocalStorageSettingsHandler";
const HOMESERVER_URL_KEY = "mx_hs_url";
const ID_SERVER_URL_KEY = "mx_is_url";
@ -878,6 +879,7 @@ async function clearStorage(opts?: { deleteEverything?: boolean }): Promise<void
const registrationTime = window.localStorage.getItem("mx_registration_time");
window.localStorage.clear();
AbstractLocalStorageSettingsHandler.clear();
try {
await StorageManager.idbDelete("account", "mx_access_token");