From 588788fbef6fc49e507b5f5b28ba3c930e47f82b Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Wed, 14 Sep 2022 00:37:06 +0200 Subject: [PATCH] fix snapshot diff calculation naming bug --- src/types/YText.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/YText.js b/src/types/YText.js index 2079e1a7..896fcdd4 100644 --- a/src/types/YText.js +++ b/src/types/YText.js @@ -1018,12 +1018,12 @@ export class YText extends AbstractType { case ContentString: { const cur = currentAttributes.get('ychange') if (snapshot !== undefined && !isVisible(n, snapshot)) { - if (cur === undefined || cur.user !== n.id.client || cur.state !== 'removed') { + if (cur === undefined || cur.user !== n.id.client || cur.type !== 'removed') { packStr() currentAttributes.set('ychange', computeYChange ? computeYChange('removed', n.id) : { type: 'removed' }) } } else if (prevSnapshot !== undefined && !isVisible(n, prevSnapshot)) { - if (cur === undefined || cur.user !== n.id.client || cur.state !== 'added') { + if (cur === undefined || cur.user !== n.id.client || cur.type !== 'added') { packStr() currentAttributes.set('ychange', computeYChange ? computeYChange('added', n.id) : { type: 'added' }) }