1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-09-06 00:28:04 +02: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.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);
});
});
}