diff --git a/src/Lifecycle.ts b/src/Lifecycle.ts index 763cfa1e87..417309eb64 100644 --- a/src/Lifecycle.ts +++ b/src/Lifecycle.ts @@ -940,6 +940,7 @@ export function stopMatrixClient(unsetClient = true): void { if (unsetClient) { MatrixClientPeg.unset(); EventIndexPeg.unset(); + cli.store.destroy(); } } } diff --git a/src/MatrixClientPeg.ts b/src/MatrixClientPeg.ts index 52d91dc9d1..c318f5e4d0 100644 --- a/src/MatrixClientPeg.ts +++ b/src/MatrixClientPeg.ts @@ -194,6 +194,7 @@ class MatrixClientPegClass implements IMatrixClientPeg { private onUnexpectedStoreClose = async (): Promise => { if (!this.matrixClient) return; this.matrixClient.stopClient(); // stop the client as the database has failed + this.matrixClient.store.destroy(); if (!this.matrixClient.isGuest()) { // If the user is not a guest then prompt them to reload rather than doing it for them