Clear local database after encryption status change to clear indexeddb logs
This commit is contained in:
@@ -154,13 +154,12 @@ class AccountMenu {
|
||||
}
|
||||
|
||||
if($scope.formData.mergeLocal) {
|
||||
syncManager.markAllItemsDirtyAndSaveOffline(function(){
|
||||
block();
|
||||
}, true)
|
||||
|
||||
// Allows desktop to make backup file
|
||||
$rootScope.$broadcast("major-data-change");
|
||||
} else {
|
||||
$scope.clearDatabaseAndRewriteAllItems(true, block);
|
||||
}
|
||||
|
||||
else {
|
||||
modelManager.resetLocalMemory();
|
||||
storageManager.clearAllModels(function(){
|
||||
block();
|
||||
@@ -168,6 +167,17 @@ class AccountMenu {
|
||||
}
|
||||
}
|
||||
|
||||
// Allows indexeddb unencrypted logs to be deleted
|
||||
// clearAllModels will remove data from backing store, but not from working memory
|
||||
// See: https://github.com/standardnotes/desktop/issues/131
|
||||
$scope.clearDatabaseAndRewriteAllItems = function(alternateUuids, callback) {
|
||||
storageManager.clearAllModels(function(){
|
||||
syncManager.markAllItemsDirtyAndSaveOffline(function(){
|
||||
callback && callback();
|
||||
}, alternateUuids)
|
||||
});
|
||||
}
|
||||
|
||||
$scope.destroyLocalData = function() {
|
||||
if(!confirm("Are you sure you want to end your session? This will delete all local items and extensions.")) {
|
||||
return;
|
||||
@@ -533,9 +543,9 @@ class AccountMenu {
|
||||
}, 10);
|
||||
|
||||
if(offline) {
|
||||
syncManager.markAllItemsDirtyAndSaveOffline();
|
||||
// Allows desktop to make backup file
|
||||
$rootScope.$broadcast("major-data-change");
|
||||
$scope.clearDatabaseAndRewriteAllItems(false);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -140,6 +140,13 @@ input, button, select, textarea {
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
button {
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
|
||||
Reference in New Issue
Block a user