mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 00:03:56 +00:00
check last sync before revision date
This commit is contained in:
@@ -216,14 +216,16 @@ export class SyncService implements SyncServiceAbstraction {
|
||||
return [true, false];
|
||||
}
|
||||
|
||||
const lastSync = await this.getLastSync();
|
||||
if (lastSync == null || lastSync.getTime() === 0) {
|
||||
return [true, false];
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await this.apiService.getAccountRevisionDate();
|
||||
const accountRevisionDate = new Date(response);
|
||||
const lastSync = await this.getLastSync();
|
||||
if (lastSync != null && accountRevisionDate <= lastSync) {
|
||||
if (new Date(response) <= lastSync) {
|
||||
return [false, false];
|
||||
}
|
||||
|
||||
return [true, false];
|
||||
} catch (e) {
|
||||
return [false, true];
|
||||
|
||||
Reference in New Issue
Block a user