diff --git a/packages/app/src/components/workspace-setting/SyncPage.tsx b/packages/app/src/components/workspace-setting/SyncPage.tsx index 6c15773d99..fb0dc5aabc 100644 --- a/packages/app/src/components/workspace-setting/SyncPage.tsx +++ b/packages/app/src/components/workspace-setting/SyncPage.tsx @@ -40,7 +40,7 @@ export const SyncPage = ({ workspace }: { workspace: WorkspaceInfo }) => { confirmText: user ? 'Enable' : 'Sign in and Enable', cancelText: 'Skip', }).then(async confirm => { - if (confirm) { + if (confirm && currentWorkspace) { // if (user) { // await login(); // } 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 && (