1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-07-03 11:44:45 +02:00

setLastSync whenever account revision check determines that nothing has changed

This commit is contained in:
Kyle Spearrin 2017-03-14 22:51:47 -04:00
parent a4f89c74ac
commit ec08efdcd7

View File

@ -29,15 +29,17 @@ function initSyncService() {
var now = new Date();
needsSyncing(self, forceSync, function (needsSync) {
if (!needsSync) {
self.syncCompleted(false);
callback(false);
self.setLastSync(now, function () {
self.syncCompleted(false);
callback(false);
});
return;
}
syncVault(userId).then(function () {
return syncSettings(userId);
}).then(function () {
self.setLastSync(new Date(), function () {
self.setLastSync(now, function () {
self.syncCompleted(true);
callback(true);
});
@ -61,8 +63,6 @@ function initSyncService() {
}
self.getLastSync(function (lastSync) {
var now = new Date();
self.apiService.getAccountRevisionDate(function (response) {
var accountRevisionDate = new Date(response);
if (lastSync && accountRevisionDate <= lastSync) {