sync wip
This commit is contained in:
@@ -207,8 +207,9 @@ angular.module('app.frontend')
|
||||
|
||||
var original = this.note.presentation_name;
|
||||
this.note.presentation_name = this.url.token;
|
||||
modelManager.addDirtyItems([this.note]);
|
||||
|
||||
apiController.saveItems([this.note], function(response){
|
||||
apiController.sync(function(response){
|
||||
if(!response) {
|
||||
this.note.presentation_name = original;
|
||||
this.url.token = original;
|
||||
|
||||
@@ -74,9 +74,7 @@ angular.module('app.frontend')
|
||||
}
|
||||
|
||||
this.refreshData = function() {
|
||||
apiController.refreshItems(function(items){
|
||||
|
||||
})
|
||||
apiController.sync(null);
|
||||
}
|
||||
|
||||
this.loginSubmitPressed = function() {
|
||||
|
||||
@@ -9,9 +9,9 @@ angular.module('app.frontend')
|
||||
$scope.tags = modelManager.tags;
|
||||
$scope.allTag.notes = modelManager.notes;
|
||||
|
||||
// setInterval(function () {
|
||||
// apiController.refreshItems(null);
|
||||
// }, 1000);
|
||||
setInterval(function () {
|
||||
apiController.sync(null);
|
||||
}, 1000);
|
||||
|
||||
// apiController.verifyEncryptionStatusOfAllItems($scope.defaultUser, function(success){});
|
||||
}
|
||||
@@ -51,7 +51,8 @@ angular.module('app.frontend')
|
||||
}
|
||||
|
||||
$scope.tagsSave = function(tag, callback) {
|
||||
apiController.saveItems([tag], callback);
|
||||
modelManager.addDirtyItems([tag]);
|
||||
apiController.sync(callback);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -65,7 +66,7 @@ angular.module('app.frontend')
|
||||
modelManager.addTagToNote(newTag, originalNote);
|
||||
}
|
||||
|
||||
apiController.saveDirtyItems(function(){});
|
||||
apiController.sync(function(){});
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -109,7 +110,7 @@ angular.module('app.frontend')
|
||||
$scope.saveNote = function(note, callback) {
|
||||
modelManager.addDirtyItems(note);
|
||||
|
||||
apiController.saveDirtyItems(function(){
|
||||
apiController.sync(function(){
|
||||
note.hasChanges = false;
|
||||
|
||||
if(callback) {
|
||||
@@ -133,7 +134,7 @@ angular.module('app.frontend')
|
||||
}
|
||||
|
||||
apiController.deleteItem(note, function(success){})
|
||||
apiController.saveDirtyItems(function(){});
|
||||
apiController.sync(function(){});
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user