Handle setDirty with updateClientDate defaulting to false
This commit is contained in:
@@ -247,9 +247,9 @@ angular.module('app')
|
||||
|
||||
var statusTimeout;
|
||||
|
||||
this.saveNote = function(note, callback, dontUpdateClientModified, dontUpdatePreviews) {
|
||||
this.saveNote = function(note, callback, updateClientModified, dontUpdatePreviews) {
|
||||
// We don't want to update the client modified date if toggling lock for note.
|
||||
note.setDirty(true, dontUpdateClientModified);
|
||||
note.setDirty(true, updateClientModified);
|
||||
|
||||
if(!dontUpdatePreviews) {
|
||||
let limit = 80;
|
||||
@@ -280,7 +280,7 @@ angular.module('app')
|
||||
}
|
||||
|
||||
let saveTimeout;
|
||||
this.changesMade = function({bypassDebouncer, dontUpdateClientModified, dontUpdatePreviews} = {}) {
|
||||
this.changesMade = function({bypassDebouncer, updateClientModified, dontUpdatePreviews} = {}) {
|
||||
let note = this.note;
|
||||
note.dummy = false;
|
||||
|
||||
@@ -318,7 +318,7 @@ angular.module('app')
|
||||
this.showErrorStatus();
|
||||
}, 200)
|
||||
}
|
||||
}, dontUpdateClientModified, dontUpdatePreviews);
|
||||
}, updateClientModified, dontUpdatePreviews);
|
||||
}, delay)
|
||||
}
|
||||
|
||||
@@ -351,7 +351,7 @@ angular.module('app')
|
||||
|
||||
this.contentChanged = function() {
|
||||
// content changes should bypass manual debouncer as we use the built in ng-model-options debouncer
|
||||
this.changesMade({bypassDebouncer: true});
|
||||
this.changesMade({bypassDebouncer: true, updateClientModified: true});
|
||||
}
|
||||
|
||||
this.onTitleEnter = function($event) {
|
||||
@@ -361,7 +361,7 @@ angular.module('app')
|
||||
}
|
||||
|
||||
this.onTitleChange = function() {
|
||||
this.changesMade({dontUpdatePreviews: true});
|
||||
this.changesMade({dontUpdatePreviews: true, updateClientModified: true});
|
||||
}
|
||||
|
||||
this.onNameFocus = function() {
|
||||
@@ -398,7 +398,7 @@ angular.module('app')
|
||||
this.remove()(this.note);
|
||||
} else {
|
||||
this.note.content.trashed = true;
|
||||
this.changesMade({bypassDebouncer: true, dontUpdateClientModified: true, dontUpdatePreviews: true});
|
||||
this.changesMade({bypassDebouncer: true, dontUpdatePreviews: true});
|
||||
}
|
||||
this.showMenu = false;
|
||||
}
|
||||
@@ -416,7 +416,7 @@ angular.module('app')
|
||||
|
||||
this.restoreTrashedNote = function() {
|
||||
this.note.content.trashed = false;
|
||||
this.changesMade({bypassDebouncer: true, dontUpdateClientModified: true, dontUpdatePreviews: true});
|
||||
this.changesMade({bypassDebouncer: true, dontUpdatePreviews: true});
|
||||
}
|
||||
|
||||
this.deleteNotePermanantely = function() {
|
||||
@@ -442,12 +442,12 @@ angular.module('app')
|
||||
|
||||
this.toggleLockNote = function() {
|
||||
this.note.setAppDataItem("locked", !this.note.locked);
|
||||
this.changesMade({bypassDebouncer: true, dontUpdateClientModified: true, dontUpdatePreviews: true});
|
||||
this.changesMade({bypassDebouncer: true, dontUpdatePreviews: true});
|
||||
}
|
||||
|
||||
this.toggleProtectNote = function() {
|
||||
this.note.content.protected = !this.note.content.protected;
|
||||
this.changesMade({bypassDebouncer: true, dontUpdateClientModified: true, dontUpdatePreviews: true});
|
||||
this.changesMade({bypassDebouncer: true, dontUpdatePreviews: true});
|
||||
|
||||
// Show privilegesManager if Protection is not yet set up
|
||||
privilegesManager.actionHasPrivilegesConfigured(PrivilegesManager.ActionViewProtectedNotes).then((configured) => {
|
||||
@@ -459,7 +459,7 @@ angular.module('app')
|
||||
|
||||
this.toggleNotePreview = function() {
|
||||
this.note.content.hidePreview = !this.note.content.hidePreview;
|
||||
this.changesMade({bypassDebouncer: true, dontUpdateClientModified: true, dontUpdatePreviews: true});
|
||||
this.changesMade({bypassDebouncer: true, dontUpdatePreviews: true});
|
||||
}
|
||||
|
||||
this.toggleArchiveNote = function() {
|
||||
|
||||
@@ -371,7 +371,7 @@ angular.module('app')
|
||||
this.selectedNote = note;
|
||||
if(note.content.conflict_of) {
|
||||
note.content.conflict_of = null; // clear conflict
|
||||
note.setDirty(true, true);
|
||||
note.setDirty(true);
|
||||
syncManager.sync();
|
||||
}
|
||||
this.selectionMade()(note);
|
||||
|
||||
@@ -109,7 +109,7 @@ angular.module('app')
|
||||
this.selectedTag = tag;
|
||||
if(tag.content.conflict_of) {
|
||||
tag.content.conflict_of = null; // clear conflict
|
||||
tag.setDirty(true, true);
|
||||
tag.setDirty(true);
|
||||
syncManager.sync();
|
||||
}
|
||||
this.selectionMade()(tag);
|
||||
|
||||
@@ -27,7 +27,7 @@ class EditorMenu {
|
||||
if(component) {
|
||||
if(component.content.conflict_of) {
|
||||
component.content.conflict_of = null; // clear conflict if applicable
|
||||
component.setDirty(true, true);
|
||||
component.setDirty(true);
|
||||
syncManager.sync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ class ComponentManager extends SNComponentManager {
|
||||
platform: getPlatformString()
|
||||
});
|
||||
|
||||
// this.loggingEnabled = true;
|
||||
|
||||
this.$compile = $compile;
|
||||
this.$rootScope = $rootScope;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ class MigrationManager extends SFMigrationManager {
|
||||
if(clientData) {
|
||||
note.setDomainDataItem(component.uuid, clientData, ComponentManager.ClientDataDomain);
|
||||
note.setDomainDataItem(component.hosted_url, null, ComponentManager.ClientDataDomain);
|
||||
note.setDirty(true, true); // dont update client date
|
||||
note.setDirty(true);
|
||||
hasChanges = true;
|
||||
}
|
||||
}
|
||||
@@ -126,14 +126,14 @@ class MigrationManager extends SFMigrationManager {
|
||||
let tag = this.modelManager.findItem(reference.uuid);
|
||||
if(tag && !tag.hasRelationshipWithItem(note)) {
|
||||
tag.addItemAsRelationship(note);
|
||||
tag.setDirty(true, true);
|
||||
tag.setDirty(true);
|
||||
dirtyCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if(newReferences.length != references.length) {
|
||||
note.content.references = newReferences;
|
||||
note.setDirty(true, true);
|
||||
note.setDirty(true);
|
||||
dirtyCount++;
|
||||
}
|
||||
}
|
||||
|
||||
7153
package-lock.json
generated
7153
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -39,7 +39,7 @@
|
||||
"mocha": "^5.2.0",
|
||||
"serve-static": "^1.13.2",
|
||||
"sn-stylekit": "2.0.14",
|
||||
"snjs": "0.2.1",
|
||||
"standard-file-js": "0.3.58"
|
||||
"snjs": "file:~/Desktop/sn/dev/snjs",
|
||||
"standard-file-js": "file:~/Desktop/sn/dev/sfjs"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user