Dont update client date when locking
This commit is contained in:
@@ -243,7 +243,7 @@ angular.module('app')
|
|||||||
|
|
||||||
var statusTimeout;
|
var statusTimeout;
|
||||||
|
|
||||||
this.save = function($event) {
|
this.save = function(dontUpdateClientModified) {
|
||||||
var note = this.note;
|
var note = this.note;
|
||||||
note.dummy = false;
|
note.dummy = false;
|
||||||
// Make sure the note exists. A safety measure, as toggling between tags triggers deletes for dummy notes.
|
// Make sure the note exists. A safety measure, as toggling between tags triggers deletes for dummy notes.
|
||||||
@@ -265,11 +265,12 @@ angular.module('app')
|
|||||||
this.showErrorStatus();
|
this.showErrorStatus();
|
||||||
}, 200)
|
}, 200)
|
||||||
}
|
}
|
||||||
});
|
}, dontUpdateClientModified);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.saveNote = function(note, callback) {
|
this.saveNote = function(note, callback, dontUpdateClientModified) {
|
||||||
note.setDirty(true);
|
// We don't want to update the client modified date if toggling lock for note.
|
||||||
|
note.setDirty(true, dontUpdateClientModified);
|
||||||
|
|
||||||
syncManager.sync().then((response) => {
|
syncManager.sync().then((response) => {
|
||||||
if(response && response.error) {
|
if(response && response.error) {
|
||||||
@@ -296,7 +297,7 @@ angular.module('app')
|
|||||||
}
|
}
|
||||||
|
|
||||||
var saveTimeout;
|
var saveTimeout;
|
||||||
this.changesMade = function(bypassDebouncer = false) {
|
this.changesMade = function({bypassDebouncer, dontUpdateClientModified} = {}) {
|
||||||
this.note.dummy = false;
|
this.note.dummy = false;
|
||||||
|
|
||||||
/* In the case of keystrokes, saving should go through a debouncer to avoid frequent calls.
|
/* In the case of keystrokes, saving should go through a debouncer to avoid frequent calls.
|
||||||
@@ -313,7 +314,7 @@ angular.module('app')
|
|||||||
if(statusTimeout) $timeout.cancel(statusTimeout);
|
if(statusTimeout) $timeout.cancel(statusTimeout);
|
||||||
saveTimeout = $timeout(() => {
|
saveTimeout = $timeout(() => {
|
||||||
this.showSavingStatus();
|
this.showSavingStatus();
|
||||||
this.save();
|
this.save(dontUpdateClientModified);
|
||||||
}, delay)
|
}, delay)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,7 +347,7 @@ angular.module('app')
|
|||||||
|
|
||||||
this.contentChanged = function() {
|
this.contentChanged = function() {
|
||||||
// content changes should bypass manual debouncer as we use the built in ng-model-options debouncer
|
// content changes should bypass manual debouncer as we use the built in ng-model-options debouncer
|
||||||
this.changesMade(true);
|
this.changesMade({bypassDebouncer: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.nameChanged = function() {
|
this.nameChanged = function() {
|
||||||
@@ -387,12 +388,13 @@ angular.module('app')
|
|||||||
|
|
||||||
this.toggleLockNote = function() {
|
this.toggleLockNote = function() {
|
||||||
this.note.setAppDataItem("locked", !this.note.locked);
|
this.note.setAppDataItem("locked", !this.note.locked);
|
||||||
this.changesMade();
|
var dontUpdateClientModified = true;
|
||||||
|
this.changesMade({dontUpdateClientModified});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.toggleArchiveNote = function() {
|
this.toggleArchiveNote = function() {
|
||||||
this.note.setAppDataItem("archived", !this.note.archived);
|
this.note.setAppDataItem("archived", !this.note.archived);
|
||||||
this.changesMade(true);
|
this.changesMade({bypassDebouncer: true});
|
||||||
$rootScope.$broadcast("noteArchived");
|
$rootScope.$broadcast("noteArchived");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ SFItem.AppDomain = "org.standardnotes.sn";
|
|||||||
|
|
||||||
class ModelManager extends SFModelManager {
|
class ModelManager extends SFModelManager {
|
||||||
|
|
||||||
constructor(storageManager) {
|
constructor(storageManager, $timeout) {
|
||||||
super();
|
super($timeout);
|
||||||
this.notes = [];
|
this.notes = [];
|
||||||
this.tags = [];
|
this.tags = [];
|
||||||
this.components = [];
|
this.components = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user