diff --git a/app/assets/javascripts/app/services/directives/views/accountMenu.js b/app/assets/javascripts/app/services/directives/views/accountMenu.js index b8a2b7ad6..21ddfe81d 100644 --- a/app/assets/javascripts/app/services/directives/views/accountMenu.js +++ b/app/assets/javascripts/app/services/directives/views/accountMenu.js @@ -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); } }) }) diff --git a/app/assets/stylesheets/app/_ui.scss b/app/assets/stylesheets/app/_ui.scss index 3bd163a6d..fcbaa03eb 100644 --- a/app/assets/stylesheets/app/_ui.scss +++ b/app/assets/stylesheets/app/_ui.scss @@ -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;