delete items on signout
This commit is contained in:
25
vendor/assets/javascripts/transpiled.js
vendored
25
vendor/assets/javascripts/transpiled.js
vendored
@@ -793,8 +793,9 @@ angular.module('app.frontend').controller('BaseCtrl', BaseCtrl);
|
||||
|
||||
this.signOutPressed = function () {
|
||||
this.showAccountMenu = false;
|
||||
apiController.signout();
|
||||
window.location.reload();
|
||||
apiController.signout(function () {
|
||||
window.location.reload();
|
||||
});
|
||||
};
|
||||
|
||||
this.submitPasswordChange = function () {
|
||||
@@ -957,7 +958,7 @@ angular.module('app.frontend').controller('BaseCtrl', BaseCtrl);
|
||||
// refresh every 30s
|
||||
setInterval(function () {
|
||||
apiController.sync(null);
|
||||
}, 30000);
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
$scope.allTag = new Tag({ all: true });
|
||||
@@ -2487,8 +2488,11 @@ var Tag = function (_Item3) {
|
||||
localStorage.setItem('mk', mk);
|
||||
};
|
||||
|
||||
this.signout = function () {
|
||||
localStorage.clear();
|
||||
this.signout = function (callback) {
|
||||
dbManager.clearAllItems(function () {
|
||||
localStorage.clear();
|
||||
callback();
|
||||
});
|
||||
};
|
||||
|
||||
this.encryptSingleItem = function (item, masterKey) {
|
||||
@@ -2711,6 +2715,17 @@ var DBManager = function () {
|
||||
};
|
||||
}, null);
|
||||
}
|
||||
}, {
|
||||
key: 'clearAllItems',
|
||||
value: function clearAllItems(callback) {
|
||||
this.openDatabase(function (db) {
|
||||
var request = db.transaction("items", "readwrite").objectStore("items").clear();
|
||||
request.onsuccess = function (event) {
|
||||
console.log("Successfully cleared items");
|
||||
callback();
|
||||
};
|
||||
}, null);
|
||||
}
|
||||
}]);
|
||||
|
||||
return DBManager;
|
||||
|
||||
2
vendor/assets/javascripts/transpiled.js.map
vendored
2
vendor/assets/javascripts/transpiled.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user