handle revision api failure case

This commit is contained in:
Kyle Spearrin 2017-08-28 11:24:14 -04:00
parent 87db27be84
commit c40465f292
1 changed files with 2 additions and 9 deletions

View File

@ -8,7 +8,6 @@
this.cryptoService = cryptoService;
this.syncInProgress = false;
this.logoutCallback = logoutCallback;
this.lastRevisionCheck = null;
initSyncService();
}
@ -76,14 +75,6 @@ function initSyncService() {
return;
}
var now = new Date();
if (self.lastRevisionCheck && (now - self.lastRevisionCheck) < 10000) {
// can only check revision every 10 seconds
callback(false, true);
return;
}
self.lastRevisionCheck = now;
self.getLastSync(function (lastSync) {
self.apiService.getAccountRevisionDate(function (response) {
var accountRevisionDate = new Date(response);
@ -93,6 +84,8 @@ function initSyncService() {
}
callback(true, false);
}, function () {
callback(false, true);
});
});
}