You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-16 22:01:54 +03:00
Lifecycle: Move the event index deletion into the clear storage method.
This commit is contained in:
@ -613,7 +613,6 @@ 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();
|
||||||
}
|
}
|
||||||
@ -633,7 +632,13 @@ function _clearStorage() {
|
|||||||
// we'll never make any requests, so can pass a bogus HS URL
|
// we'll never make any requests, so can pass a bogus HS URL
|
||||||
baseUrl: "",
|
baseUrl: "",
|
||||||
});
|
});
|
||||||
return cli.clearStores();
|
|
||||||
|
const clear = async() => {
|
||||||
|
await EventIndexPeg.deleteEventIndex();
|
||||||
|
await cli.clearStores();
|
||||||
|
}
|
||||||
|
|
||||||
|
return clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user