clear auth hash depending on version
This commit is contained in:
@@ -172,7 +172,7 @@ class SyncManager {
|
||||
params.sync_token = this.syncToken;
|
||||
params.cursor_token = this.cursorToken;
|
||||
|
||||
this.httpManager.postAbsolute(this.syncURL, params, function(response){
|
||||
var onSyncSuccess = function(response) {
|
||||
this.modelManager.clearDirtyItems(subItems);
|
||||
this.syncStatus.error = null;
|
||||
|
||||
@@ -209,19 +209,33 @@ class SyncManager {
|
||||
} else {
|
||||
this.callQueuedCallbacksAndCurrent(callback, response);
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
}.bind(this), function(response){
|
||||
console.log("Sync error: ", response);
|
||||
var error = response ? response.error : {message: "Could not connect to server."};
|
||||
try {
|
||||
this.httpManager.postAbsolute(this.syncURL, params, function(response){
|
||||
|
||||
this.syncStatus.syncOpInProgress = false;
|
||||
this.syncStatus.error = error;
|
||||
this.writeItemsToLocalStorage(allDirtyItems, false, null);
|
||||
try {
|
||||
onSyncSuccess(response);
|
||||
} catch(e) {
|
||||
console.log("Caught sync success exception:", e);
|
||||
}
|
||||
|
||||
this.$rootScope.$broadcast("sync:error", error);
|
||||
}.bind(this), function(response){
|
||||
console.log("Sync error: ", response);
|
||||
var error = response ? response.error : {message: "Could not connect to server."};
|
||||
|
||||
this.callQueuedCallbacksAndCurrent(callback, {error: "Sync error"});
|
||||
}.bind(this));
|
||||
this.syncStatus.syncOpInProgress = false;
|
||||
this.syncStatus.error = error;
|
||||
this.writeItemsToLocalStorage(allDirtyItems, false, null);
|
||||
|
||||
this.$rootScope.$broadcast("sync:error", error);
|
||||
|
||||
this.callQueuedCallbacksAndCurrent(callback, {error: "Sync error"});
|
||||
}.bind(this));
|
||||
}
|
||||
catch(e) {
|
||||
console.log("Sync exception caught:", e);
|
||||
}
|
||||
}
|
||||
|
||||
handleUnsavedItemsResponse(unsaved) {
|
||||
|
||||
Reference in New Issue
Block a user