mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 01:49:51 +08:00
change workspacetype to worksopace until
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
import {
|
||||
PropsWithChildren,
|
||||
ReactElement,
|
||||
@@ -31,10 +30,10 @@ const Page: NextPageWithLayout = () => {
|
||||
<EditorHeader />
|
||||
<MobileModal />
|
||||
|
||||
{currentPage && currentWorkspace && (
|
||||
{currentPage && currentWorkspace?.blocksuiteWorkspace && (
|
||||
<DynamicBlocksuite
|
||||
page={currentPage}
|
||||
workspace={currentWorkspace}
|
||||
workspace={currentWorkspace.blocksuiteWorkspace}
|
||||
setEditor={setEditorHandler}
|
||||
/>
|
||||
)}
|
||||
@@ -52,9 +51,10 @@ const PageDefender = ({ children }: PropsWithChildren) => {
|
||||
useEffect(() => {
|
||||
const initPage = async () => {
|
||||
const pageId = router.query.pageId as string;
|
||||
const isPageExist = !!currentWorkspace!.meta.pageMetas.find(
|
||||
p => p.id === pageId
|
||||
);
|
||||
const isPageExist =
|
||||
currentWorkspace?.blocksuiteWorkspace?.meta?.pageMetas.find(
|
||||
p => p.id === pageId
|
||||
);
|
||||
if (!isPageExist) {
|
||||
await createPage({ pageId });
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@ const WorkspaceIndex = () => {
|
||||
if (!workspaceLoaded) {
|
||||
return;
|
||||
}
|
||||
const savedPageId = currentWorkspace?.meta.pageMetas[0]?.id;
|
||||
const savedPageId =
|
||||
currentWorkspace?.blocksuiteWorkspace?.meta.pageMetas[0]?.id;
|
||||
if (savedPageId) {
|
||||
router.replace(`/workspace/${activeWorkspaceId}/${savedPageId}`);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user