LifeCycle: Stop the crawler and delete the index when whe log out.

pull/21833/head
Damir Jelić 2019-11-12 15:58:38 +01:00
parent d69eb78b66
commit 3502454c61
1 changed files with 2 additions and 0 deletions

View File

@ -613,6 +613,7 @@ export function onLoggedOut() {
// so that React components unmount first. This avoids React soft crashes // so that React components unmount first. This avoids React soft crashes
// that can occur when components try to use a null client. // that can occur when components try to use a null client.
dis.dispatch({action: 'on_logged_out'}); dis.dispatch({action: 'on_logged_out'});
EventIndexPeg.deleteEventIndex().done();
stopMatrixClient(); stopMatrixClient();
_clearStorage().done(); _clearStorage().done();
} }
@ -648,6 +649,7 @@ export function stopMatrixClient(unsetClient=true) {
ActiveWidgetStore.stop(); ActiveWidgetStore.stop();
IntegrationManagers.sharedInstance().stopWatching(); IntegrationManagers.sharedInstance().stopWatching();
if (DMRoomMap.shared()) DMRoomMap.shared().stop(); if (DMRoomMap.shared()) DMRoomMap.shared().stop();
EventIndexPeg.stop();
const cli = MatrixClientPeg.get(); const cli = MatrixClientPeg.get();
if (cli) { if (cli) {
cli.stopClient(); cli.stopClient();