Delete database on logout. DI a SyncAccumulator. Log uncaught errors

This commit is contained in:
Kegan Dougal 2017-02-10 14:22:54 +00:00
parent 300cd962e5
commit 407bcf1bb9
2 changed files with 14 additions and 1 deletions

View file

@ -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;