Parcourir la source

Call ytextLength before syncYDoc

Shun Miyazawa il y a 1 an
Parent
commit
83c8e9e76b
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      apps/app/src/server/service/yjs/yjs.ts

+ 1 - 1
apps/app/src/server/service/yjs/yjs.ts

@@ -188,10 +188,10 @@ class YjsService implements IYjsService {
       return;
     }
 
+    const ytextLength = doc?.getText('codemirror').length;
     syncYDoc(this.mdb, doc, true);
 
     if (editingMarkdownLength != null) {
-      const ytextLength = doc?.getText('codemirror').length;
       return { isYjsDataBroken: editingMarkdownLength !== ytextLength };
     }
   }