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