mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
fixup: make sure to toggle remote client state at save too
Co-authored-by: David Larlet <david@larlet.fr>
This commit is contained in:
parent
dfdfae0080
commit
5cb7cb2738
1 changed files with 7 additions and 1 deletions
|
@ -399,6 +399,7 @@ export class SyncEngine {
|
||||||
onSavedMessage({ sender, lastKnownHLC }) {
|
onSavedMessage({ sender, lastKnownHLC }) {
|
||||||
debug(`received saved message from peer ${sender}`, lastKnownHLC)
|
debug(`received saved message from peer ${sender}`, lastKnownHLC)
|
||||||
this._operations.saved(lastKnownHLC)
|
this._operations.saved(lastKnownHLC)
|
||||||
|
this._undoManager.toggleState()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -471,7 +472,7 @@ export class Operations {
|
||||||
}
|
}
|
||||||
|
|
||||||
saved(hlc) {
|
saved(hlc) {
|
||||||
for (const operation of this.getOperationsSince(hlc)) {
|
for (const operation of this.getOperationsBefore(hlc)) {
|
||||||
operation.dirty = false
|
operation.dirty = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -543,6 +544,11 @@ export class Operations {
|
||||||
return this._operations.filter((op) => op.hlc > hlc)
|
return this._operations.filter((op) => op.hlc > hlc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getOperationsBefore(hlc) {
|
||||||
|
if (!hlc) return this._operations
|
||||||
|
return this._operations.filter((op) => op.hlc <= hlc)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the last known HLC value.
|
* Returns the last known HLC value.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue