Skip to content

Commit

Permalink
fix(portable-text-editor): don't sync if empty patches
Browse files Browse the repository at this point in the history
  • Loading branch information
skogsmaskin authored and rexxars committed Sep 23, 2022
1 parent a17efef commit 96771df
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export function createWithPatches(
if (incomingPatches$) {
debug('Subscribing to patches')
patchSubscription = incomingPatches$.subscribe(({patches, snapshot}) => {
debug('Incoming patches', patches)
const remotePatches = patches.filter((p) => p.origin !== 'local')
if (remotePatches.length !== 0) {
Editor.withoutNormalizing(editor, () => {
Expand All @@ -141,7 +142,9 @@ export function createWithPatches(
})
})
}
syncValueAfterIncomingPatches()
if (patches.length > 0) {
syncValueAfterIncomingPatches()
}
})
}

Expand Down

0 comments on commit 96771df

Please sign in to comment.