Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: listen

himself6560f8366f0049
diff --git a/packages/app/src/pages/workspace/[workspaceId]/[pageId].tsx b/packages/app/src/pages/workspace/[workspaceId]/[pageId].tsx
index 54a1b0c7f8..b1f6bd4788 100644
--- a/packages/app/src/pages/workspace/[workspaceId]/[pageId].tsx
+++ b/packages/app/src/pages/workspace/[workspaceId]/[pageId].tsx
@@ -42,11 +42,11 @@ const Page: NextPageWithLayout = () => {
let disposable: Disposable | undefined;
const editor = createEditor?.current?.(currentPage!);
+ const isFirstPage = currentWorkspace?.meta.pageMetas.length === 1;
if (editor) {
editorContainer.current?.appendChild(editor);
setEditor?.current?.(editor);
if (currentPage!.isEmpty) {
- const isFirstPage = currentWorkspace?.meta.pageMetas.length === 1;
// Can not use useCurrentPageMeta to get new title, cause meta title will trigger rerender, but the second time can not remove title
const { title: metaTitle } = currentPage!.meta;
const title = metaTitle ? metaTitle : isFirstPage ? firstPageTitle : '';
@@ -72,12 +72,12 @@ const Page: NextPageWithLayout = () => {
});
}
currentPage!.resetHistory();
- disposable = editor.pageBlockModel?.propsUpdated.on(() => {
- document.title = isFirstPage
- ? firstPageTitle
- : currentPage?.meta.title || 'Untitled';
- });
}
+ disposable = editor.pageBlockModel?.propsUpdated.on(() => {
+ document.title = isFirstPage
+ ? firstPageTitle
+ : currentPage?.meta.title || 'Untitled';
+ });
}
return () => {
ret();