From 6e91ec3a0ea033cc6146efde4de0b691b0a67002 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 26 Sep 2022 13:01:43 +0100 Subject: [PATCH 1/2] Clear storage after logout --- src/ClientContext.tsx | 1 + src/matrix-utils.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ClientContext.tsx b/src/ClientContext.tsx index 24b067a..c026781 100644 --- a/src/ClientContext.tsx +++ b/src/ClientContext.tsx @@ -254,6 +254,7 @@ export const ClientProvider: FC = ({ children }) => { const logout = useCallback(async () => { await client.logout(undefined, true); + await client.clearStores(); clearSession(); setState({ client: undefined, diff --git a/src/matrix-utils.ts b/src/matrix-utils.ts index 3d93a33..321c769 100644 --- a/src/matrix-utils.ts +++ b/src/matrix-utils.ts @@ -84,7 +84,7 @@ export async function initClient( const storeOpts = {} as ICreateClientOpts; - if (indexedDB && localStorage && !import.meta.env.DEV) { + if (indexedDB && localStorage /*&& !import.meta.env.DEV*/) { storeOpts.store = new IndexedDBStore({ indexedDB: window.indexedDB, localStorage, From 46ab10f733e71796068a4006dd72817d68731d52 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 26 Sep 2022 13:03:39 +0100 Subject: [PATCH 2/2] Remove unintentional commenting --- src/matrix-utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix-utils.ts b/src/matrix-utils.ts index 321c769..3d93a33 100644 --- a/src/matrix-utils.ts +++ b/src/matrix-utils.ts @@ -84,7 +84,7 @@ export async function initClient( const storeOpts = {} as ICreateClientOpts; - if (indexedDB && localStorage /*&& !import.meta.env.DEV*/) { + if (indexedDB && localStorage && !import.meta.env.DEV) { storeOpts.store = new IndexedDBStore({ indexedDB: window.indexedDB, localStorage,