Skip to content

Commit aa212bc

Browse files
committed
fix: 비어있는 content 초기 세팅 안 되는 이슈 해결
1 parent cd43ca5 commit aa212bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/backend/src/yjs/yjs.service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@ export class YjsService
9797

9898
// content가 비어있다면 내부 구조가 novel editor schema를 따르지 않기 때문에 오류가 납니다.
9999
// content가 존재할 때만 넣어줍니다.
100+
const pageContent = JSON.parse(JSON.stringify(findPage.content));
100101
const novelEditorContent = {
101102
type: 'doc',
102-
content: findPage.content,
103+
content: pageContent,
103104
};
104-
Object.keys(findPage.content).length > 0 &&
105+
pageContent.length > 0 &&
106+
// JSON.parse(findPage.content).length > 0 &&
105107
this.initializePageContent(novelEditorContent, editorDoc);
106108

107109
// 페이지 내용 변경 사항을 감지해서 데이터베이스에 갱신합니다.

0 commit comments

Comments
 (0)