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.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
fix: add judgement of currentWorkspace
QiShaoXuanb86a03642aa9
diff --git a/packages/app/src/components/workspace-setting/SyncPage.tsx b/packages/app/src/components/workspace-setting/SyncPage.tsxindex 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.tsxindex 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].tsxindex 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 = () => {<EditorHeader /><MobileModal />- {currentPage && (+ {currentPage && currentWorkspace && (<DynamicBlocksuitepage={currentPage}workspace={currentWorkspace}