1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 23:03:32 +00:00

handle revision api failure case

This commit is contained in:
Kyle Spearrin
2017-08-28 11:24:14 -04:00
parent 87db27be84
commit c40465f292

View File

@@ -8,7 +8,6 @@
this.cryptoService = cryptoService; this.cryptoService = cryptoService;
this.syncInProgress = false; this.syncInProgress = false;
this.logoutCallback = logoutCallback; this.logoutCallback = logoutCallback;
this.lastRevisionCheck = null;
initSyncService(); initSyncService();
} }
@@ -76,14 +75,6 @@ function initSyncService() {
return; 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.getLastSync(function (lastSync) {
self.apiService.getAccountRevisionDate(function (response) { self.apiService.getAccountRevisionDate(function (response) {
var accountRevisionDate = new Date(response); var accountRevisionDate = new Date(response);
@@ -93,6 +84,8 @@ function initSyncService() {
} }
callback(true, false); callback(true, false);
}, function () {
callback(false, true);
}); });
}); });
} }