Merge branch 'master' of github.com:standardnotes/web into sfv3

This commit is contained in:
Mo Bitar
2018-05-17 10:08:50 -05:00
9 changed files with 106 additions and 22 deletions

View File

@@ -193,8 +193,21 @@ class SyncManager {
this.$interval.cancel(this.syncStatus.checker);
}
lockSyncing() {
this.syncLocked = true;
}
unlockSyncing() {
this.syncLocked = false;
}
sync(callback, options = {}, source) {
if(this.syncLocked) {
console.log("Sync Locked, Returning;");
return;
}
if(!options) options = {};
if(typeof callback == 'string') {
@@ -475,7 +488,7 @@ class SyncManager {
// We want a new uuid for the new item. Note that this won't neccessarily adjust references.
itemResponse.uuid = null;
var dup = this.modelManager.createDuplicateItem(itemResponse, item);
var dup = this.modelManager.createDuplicateItem(itemResponse);
if(!itemResponse.deleted && !item.isItemContentEqualWith(dup)) {
this.modelManager.addItem(dup);
dup.conflict_of = item.uuid;