Fix wrong isRemote false caused by the incorrect promise schedule case.

pull/61/head
Ulion 3 years ago
parent f65ab040ee
commit 3ebad4902d

@ -141,7 +141,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 = false
}
}
} catch (e) {
console.error(e)

Loading…
Cancel
Save