diff --git a/packages/app/src/components/workspace-setting/general/General.tsx b/packages/app/src/components/workspace-setting/general/General.tsx index 116b5863ea..26802b4cc1 100644 --- a/packages/app/src/components/workspace-setting/general/General.tsx +++ b/packages/app/src/components/workspace-setting/general/General.tsx @@ -42,14 +42,15 @@ export const GeneralPage = ({ workspace }: { workspace: WorkspaceInfo }) => { }; const handleUpdateWorkspaceName = () => { console.log('currentWorkspace: ', currentWorkspace); - updateWorkspace({ name: workspaceName }, currentWorkspace); + currentWorkspace && + updateWorkspace({ name: workspaceName }, currentWorkspace); }; const fileChange = async (file: File) => { // console.log('file: ', file); // setUploading(true); const blob = new Blob([file], { type: file.type }); - updateWorkspace({ avatarBlob: blob }, currentWorkspace); + currentWorkspace && updateWorkspace({ avatarBlob: blob }, currentWorkspace); }; return workspace ? ( diff --git a/packages/app/src/pages/workspace/[workspaceId]/[pageId].tsx b/packages/app/src/pages/workspace/[workspaceId]/[pageId].tsx index 2fc86ff589..2ede23582e 100644 --- a/packages/app/src/pages/workspace/[workspaceId]/[pageId].tsx +++ b/packages/app/src/pages/workspace/[workspaceId]/[pageId].tsx @@ -31,7 +31,7 @@ const Page: NextPageWithLayout = () => { - {currentPage && ( + {currentPage && currentWorkspace && (