SyncManager exclude savedItems from retrievedItems, syncing source string

This commit is contained in:
Mo Bitar
2018-01-23 10:05:23 -06:00
parent 05af90290b
commit ed3f0aa620
14 changed files with 62 additions and 40 deletions

View File

@@ -143,7 +143,7 @@ angular.module('app')
}
// Lots of dirtying can happen above, so we'll sync
syncManager.sync();
syncManager.sync("editorMenuOnSelect");
}.bind(this)
this.hasAvailableExtensions = function() {

View File

@@ -69,7 +69,7 @@ angular.module('app')
this.refreshData = function() {
this.isRefreshing = true;
syncManager.sync(function(response){
syncManager.sync((response) => {
$timeout(function(){
this.isRefreshing = false;
}.bind(this), 200)
@@ -78,7 +78,7 @@ angular.module('app')
} else {
this.syncUpdated();
}
}.bind(this));
}, null, "refreshData");
}
this.syncUpdated = function() {

View File

@@ -9,8 +9,8 @@ angular.module('app')
}
/* Used to avoid circular dependencies where syncManager cannot be imported but rootScope can */
$rootScope.sync = function() {
syncManager.sync();
$rootScope.sync = function(source) {
syncManager.sync("$rootScope.sync - " + source);
}
$rootScope.lockApplication = function() {
@@ -49,7 +49,7 @@ angular.module('app')
dbManager.openDatabase(null, function() {
// new database, delete syncToken so that items can be refetched entirely from server
syncManager.clearSyncToken();
syncManager.sync();
syncManager.sync("openDatabase");
})
}
@@ -61,10 +61,10 @@ angular.module('app')
$rootScope.$broadcast("initial-data-loaded");
syncManager.sync(null);
syncManager.sync("initiateSync");
// refresh every 30s
setInterval(function () {
syncManager.sync(null);
syncManager.sync("timer");
}, 30000);
});
}
@@ -115,7 +115,7 @@ angular.module('app')
}
note.setDirty(true);
syncManager.sync();
syncManager.sync("updateTagsForNote");
}
/*
@@ -145,7 +145,7 @@ angular.module('app')
return;
}
tag.setDirty(true);
syncManager.sync(callback);
syncManager.sync(callback, null, "tagsSave");
$rootScope.$broadcast("tag-changed");
modelManager.resortTag(tag);
}
@@ -161,7 +161,7 @@ angular.module('app')
syncManager.sync(function(){
// force scope tags to update on sub directives
$scope.safeApply();
});
}, null, "removeTag");
}
}
@@ -199,7 +199,7 @@ angular.module('app')
callback(true);
}
}
})
}, null, "saveNote")
}
$scope.safeApply = function(fn) {
@@ -240,7 +240,7 @@ angular.module('app')
} else {
$scope.notifyDelete();
}
});
}, null, "deleteNote");
}