mirror of
https://github.com/cudr/slate-collaborative.git
synced 2024-10-27 20:34:06 +00:00
Merge 8b0bd1d04d
into f65ab040ee
This commit is contained in:
commit
b3f1c7c499
@ -125,6 +125,8 @@ export const AutomergeEditor = {
|
||||
if (operations.length) {
|
||||
const slateOps = toSlateOp(operations, current)
|
||||
|
||||
// do not change isRemote flag for no-op case.
|
||||
const wasRemote = e.isRemote
|
||||
e.isRemote = true
|
||||
|
||||
Editor.withoutNormalizing(e, () => {
|
||||
@ -141,7 +143,12 @@ export const AutomergeEditor = {
|
||||
e.onCursor && e.onCursor(updated.cursors)
|
||||
})
|
||||
|
||||
Promise.resolve().then(_ => (e.isRemote = false))
|
||||
if (slateOps.length > 0) {
|
||||
// XXX: only schedule set isRemote false when we did scheduled onChange by apply.
|
||||
Promise.resolve().then(_ => (e.isRemote = false))
|
||||
} else {
|
||||
e.isRemote = wasRemote
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
|
Loading…
Reference in New Issue
Block a user