mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
Lifecycle: Move the event index deletion into the clear storage method.
This commit is contained in:
parent
3502454c61
commit
008554463d
1 changed files with 7 additions and 2 deletions
|
@ -613,7 +613,6 @@ export function onLoggedOut() {
|
|||
// so that React components unmount first. This avoids React soft crashes
|
||||
// that can occur when components try to use a null client.
|
||||
dis.dispatch({action: 'on_logged_out'});
|
||||
EventIndexPeg.deleteEventIndex().done();
|
||||
stopMatrixClient();
|
||||
_clearStorage().done();
|
||||
}
|
||||
|
@ -633,7 +632,13 @@ function _clearStorage() {
|
|||
// we'll never make any requests, so can pass a bogus HS URL
|
||||
baseUrl: "",
|
||||
});
|
||||
return cli.clearStores();
|
||||
|
||||
const clear = async() => {
|
||||
await EventIndexPeg.deleteEventIndex();
|
||||
await cli.clearStores();
|
||||
}
|
||||
|
||||
return clear();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue