sync spinner

This commit is contained in:
Mo Bitar
2017-01-02 21:58:02 -06:00
parent e91994d885
commit b2621d0163
6 changed files with 35 additions and 4 deletions

View File

@@ -72,7 +72,11 @@ angular.module('app.frontend')
}
this.refreshData = function() {
this.isRefreshing = true;
apiController.sync(function(response){
$timeout(function(){
this.isRefreshing = false;
}.bind(this), 200)
if(!response) {
alert("There was an error syncing. Please try again. If all else fails, log out and log back in.");
} else {

View File

@@ -239,9 +239,12 @@ angular.module('app.frontend')
modelManager.clearDirtyItems();
this.syncToken = response.sync_token;
$rootScope.$broadcast("sync:updated_token", this.syncToken);
this.handleItemsResponse(response.retrieved_items, null);
// merge only metadata for saved items
this.handleItemsResponse(response.saved_items, ["content", "enc_item_key", "auth_hash"]);
var omitFields = ["content", "enc_item_key", "auth_hash"];
this.handleItemsResponse(response.saved_items, omitFields);
if(callback) {
callback(response);
}