fix: Layout only changes not synced to content property

This commit is contained in:
Tom Moor
2024-06-02 10:23:54 -04:00
parent cb0f03d698
commit 5bd6c7b9c7
4 changed files with 8 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
import { yDocToProsemirrorJSON } from "@getoutline/y-prosemirror";
import isEqual from "fast-deep-equal";
import uniq from "lodash/uniq";
import { Node } from "prosemirror-model";
import * as Y from "yjs";
@@ -45,7 +46,7 @@ export default async function documentCollaborativeUpdater({
const content = yDocToProsemirrorJSON(ydoc, "default") as ProsemirrorData;
const node = Node.fromJSON(schema, content);
const text = serializer.serialize(node, undefined);
const isUnchanged = document.text === text;
const isUnchanged = isEqual(document.content, content);
const lastModifiedById = userId ?? document.lastModifiedById;
if (isUnchanged) {