mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 04:06:44 +02:00
Destroy idb worker when stopping client (#10899)
* Destroy idb worker when stopping client * Iterate * Iterate * Iterate
This commit is contained in:
parent
d68a4b72d9
commit
85860cae08
@ -940,6 +940,7 @@ export function stopMatrixClient(unsetClient = true): void {
|
||||
if (unsetClient) {
|
||||
MatrixClientPeg.unset();
|
||||
EventIndexPeg.unset();
|
||||
cli.store.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,6 +194,7 @@ class MatrixClientPegClass implements IMatrixClientPeg {
|
||||
private onUnexpectedStoreClose = async (): Promise<void> => {
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user