Only make last seen update go forwards
This commit is contained in:
parent
875592deda
commit
41ffba8ec2
1 changed files with 7 additions and 1 deletions
|
|
@ -44,7 +44,13 @@ export async function applyRemoteChangesLocally({
|
|||
)
|
||||
);
|
||||
|
||||
await database.setLastSeenUpdateId(remote.lastUpdateId);
|
||||
const lastSeenUpdateId = database.getLastSeenUpdateId();
|
||||
if (
|
||||
lastSeenUpdateId === undefined ||
|
||||
remote.lastUpdateId > lastSeenUpdateId
|
||||
) {
|
||||
await database.setLastSeenUpdateId(remote.lastUpdateId);
|
||||
}
|
||||
} catch (e) {
|
||||
Logger.getInstance().error(
|
||||
`Failed to apply remote changes locally: ${e}`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue