Merge pull request #84 from weikx/fix/title-sync

fix #83
This commit is contained in:
fantasticit 2022-06-18 19:59:22 +08:00 committed by GitHub
commit 15b14fd173
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -70,10 +70,10 @@ export const EditorInstance = forwardRef((props: IProps, ref) => {
}, },
}), }),
].filter(Boolean), ].filter(Boolean),
onTransaction({ transaction }) { onUpdate({ transaction }) {
try { try {
const title = transaction.doc.content.firstChild.content.firstChild.textContent; const title = transaction.doc.content.firstChild.content.firstChild?.textContent;
onTitleUpdate(title); onTitleUpdate(title || '未命名文档');
} catch (e) { } catch (e) {
// //
} }