1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-07-05 12:04: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(); var now = new Date();
needsSyncing(self, forceSync, function (needsSync) { needsSyncing(self, forceSync, function (needsSync) {
if (!needsSync) { if (!needsSync) {
self.syncCompleted(false); self.setLastSync(now, function () {
callback(false); self.syncCompleted(false);
callback(false);
});
return; return;
} }
syncVault(userId).then(function () { syncVault(userId).then(function () {
return syncSettings(userId); return syncSettings(userId);
}).then(function () { }).then(function () {
self.setLastSync(new Date(), function () { self.setLastSync(now, function () {
self.syncCompleted(true); self.syncCompleted(true);
callback(true); callback(true);
}); });
@ -61,8 +63,6 @@ function initSyncService() {
} }
self.getLastSync(function (lastSync) { self.getLastSync(function (lastSync) {
var now = new Date();
self.apiService.getAccountRevisionDate(function (response) { self.apiService.getAccountRevisionDate(function (response) {
var accountRevisionDate = new Date(response); var accountRevisionDate = new Date(response);
if (lastSync && accountRevisionDate <= lastSync) { if (lastSync && accountRevisionDate <= lastSync) {