You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Delete database on logout. DI a SyncAccumulator. Log uncaught errors
This commit is contained in:
@@ -329,10 +329,21 @@ export function startMatrixClient() {
|
||||
*/
|
||||
export function onLoggedOut() {
|
||||
_clearLocalStorage();
|
||||
_clearIndexedDB();
|
||||
stopMatrixClient();
|
||||
dis.dispatch({action: 'on_logged_out'});
|
||||
}
|
||||
|
||||
function _clearIndexedDB() {
|
||||
// remove indexeddb instances
|
||||
if (!window.indexedDB) {
|
||||
return;
|
||||
}
|
||||
console.log("Clearing indexeddb");
|
||||
window.indexedDB.deleteDatabase("matrix-js-sdk");
|
||||
window.indexedDB.deleteDatabase("logs");
|
||||
}
|
||||
|
||||
function _clearLocalStorage() {
|
||||
if (!window.localStorage) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user