diff --git a/app/assets/javascripts/app/directives/views/accountMenu.js b/app/assets/javascripts/app/directives/views/accountMenu.js index e5ba01cb6..7142dc0fd 100644 --- a/app/assets/javascripts/app/directives/views/accountMenu.js +++ b/app/assets/javascripts/app/directives/views/accountMenu.js @@ -246,9 +246,9 @@ class AccountMenu { var onDataReady = function(errorCount) { var items = modelManager.mapResponseItemsToLocalModels(data.items, ModelManager.MappingSourceFileImport); items.forEach(function(item){ - item.setDirty(true); + item.setDirty(true, true); item.deleted = false; - item.markAllReferencesDirty(); + item.markAllReferencesDirty(true); // We don't want to activate any components during import process in case of exceptions // breaking up the import proccess diff --git a/app/assets/javascripts/app/models/api/item.js b/app/assets/javascripts/app/models/api/item.js index 5fa9e81ba..6fe6fdee7 100644 --- a/app/assets/javascripts/app/models/api/item.js +++ b/app/assets/javascripts/app/models/api/item.js @@ -87,6 +87,9 @@ class Item { if(dirty && !dontUpdateClientDate) { // Set the client modified date to now if marking the item as dirty this.client_updated_at = new Date(); + } else if(!this.hasRawClientUpdatedAtValue()) { + // copy updated_at + this.client_updated_at = new Date(this.updated_at); } if(dirty) { @@ -94,9 +97,9 @@ class Item { } } - markAllReferencesDirty() { + markAllReferencesDirty(dontUpdateClientDate) { this.allReferencedObjects().forEach(function(reference){ - reference.setDirty(true); + reference.setDirty(true, dontUpdateClientDate); }) } @@ -222,6 +225,10 @@ class Item { return this.getAppDataItem("locked"); } + hasRawClientUpdatedAtValue() { + return this.getAppDataItem("client_updated_at") != null; + } + get client_updated_at() { if(!this._client_updated_at) { var saved = this.getAppDataItem("client_updated_at"); diff --git a/app/assets/javascripts/app/services/syncManager.js b/app/assets/javascripts/app/services/syncManager.js index 4feedeb16..bb3870818 100644 --- a/app/assets/javascripts/app/services/syncManager.js +++ b/app/assets/javascripts/app/services/syncManager.js @@ -411,7 +411,7 @@ class SyncManager { ) { this.$rootScope.$broadcast("major-data-change"); } - + this.callQueuedCallbacksAndCurrent(callback, response); this.$rootScope.$broadcast("sync:completed", {retrievedItems: this.allRetreivedItems, savedItems: this.allSavedItems}); diff --git a/app/assets/templates/directives/account-menu.html.haml b/app/assets/templates/directives/account-menu.html.haml index b48d68db5..9573cc38c 100644 --- a/app/assets/templates/directives/account-menu.html.haml +++ b/app/assets/templates/directives/account-menu.html.haml @@ -158,6 +158,9 @@ .button-group.stretch.panel-row.form-submit %button.button.info{"type" => "submit"} .label Decrypt & Import + %p + Importing from backup will overwrite existing notes with matching note from backup. Existing notes not found in the backup will remain as-is and won't be overwritten. + %p If you'd like to import only a selection of notes instead of the whole file, please use the Batch Manager extension instead. .panel-row .spinner.small.info{"ng-if" => "importData.loading"} .footer diff --git a/app/assets/templates/directives/password-wizard.html.haml b/app/assets/templates/directives/password-wizard.html.haml index 737e9d9d9..6ede6d8d0 100644 --- a/app/assets/templates/directives/password-wizard.html.haml +++ b/app/assets/templates/directives/password-wizard.html.haml @@ -57,6 +57,9 @@ %li Desktop %li Web (Chrome, Firefox, Safari) %li Mobile (iOS and Android) + %p.panel-row + If you do not currently have access to a device you're signed in on, you may proceed, + but must make signing out and back in the first step upon gaining access to that device. %p.panel-row Press Continue only when you have completed signing out of all your devices. @@ -84,8 +87,8 @@ .spinner.small.inline.info.mr-5{"ng-if" => "formData.processing"} .inline.bold{"ng-class" => "{'info' : !formData.statusError, 'error' : formData.statusError}"} {{formData.status}} - .panel-column - %p.info{"ng-if" => "syncStatus.total > 0"} + .panel-column{"delay-hide" => "true", "show" => "syncStatus.syncOpInProgress || syncStatus.needsMoreSync", "delay" => "1000"} + %p.info Syncing {{syncStatus.current}}/{{syncStatus.total}} %div{"ng-if" => "step == 5"}