Merge branch 'feat/filesystem_and_search' of github.com:toeverything/AFFiNE into feat/filesystem_and_search

This commit is contained in:
alt0
2022-12-20 15:31:19 +08:00
9 changed files with 91 additions and 72 deletions
@@ -35,10 +35,10 @@ const Home: NextPage = () => {
return ret;
}
const editor = createEditor(page);
const editor = createEditor?.current?.(page);
if (editor) {
editorContainer.current?.appendChild(editor);
setEditor(editor);
setEditor?.current?.(editor);
if (page.isEmpty) {
const title = 'Welcome to the AFFiNE Alpha';
const pageId = page.addBlock({
@@ -53,7 +53,7 @@ const Home: NextPage = () => {
}
return ret;
}, [workspace, page]);
}, [workspace, page, createEditor, setEditor]);
return (
<>
@@ -19,13 +19,13 @@ const Page = () => {
return;
}
createPage()?.then(async pageId => {
createPage?.current?.()?.then(async pageId => {
if (!pageId) {
return;
}
router.push(`/workspace/${currentWorkspaceId}/${pageId}`);
});
}, [workspace, currentWorkspaceId]);
}, [workspace, currentWorkspaceId, createPage, router]);
return <div>Hello, there is [pageId]/index</div>;
};