Compute diff
This commit is contained in:
parent
f29cd2baf4
commit
ccf9a0820a
@ -286,7 +286,14 @@ export const createAbsolutePositionFromRelativePosition = (rpos, doc, followUndo
|
|||||||
if (getState(store, rightID.client) <= rightID.clock) {
|
if (getState(store, rightID.client) <= rightID.clock) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
const res = followUndoneDeletions ? followRedone(store, rightID) : { item: getItem(store, rightID), diff: 0 }
|
/** @type {ReturnType<typeof followRedone>} */
|
||||||
|
let res;
|
||||||
|
if (followUndoneDeletions) {
|
||||||
|
res = followRedone(store, rightID)
|
||||||
|
} else {
|
||||||
|
const item = getItem(store, rightID)
|
||||||
|
res = { item, diff: rightID.clock - item.id.clock }
|
||||||
|
}
|
||||||
const right = res.item
|
const right = res.item
|
||||||
if (!(right instanceof Item)) {
|
if (!(right instanceof Item)) {
|
||||||
return null
|
return null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user