fix: add judgement of currentWorkspace
This commit is contained in:
@@ -40,7 +40,7 @@ export const SyncPage = ({ workspace }: { workspace: WorkspaceInfo }) => {
|
|||||||
confirmText: user ? 'Enable' : 'Sign in and Enable',
|
confirmText: user ? 'Enable' : 'Sign in and Enable',
|
||||||
cancelText: 'Skip',
|
cancelText: 'Skip',
|
||||||
}).then(async confirm => {
|
}).then(async confirm => {
|
||||||
if (confirm) {
|
if (confirm && currentWorkspace) {
|
||||||
// if (user) {
|
// if (user) {
|
||||||
// await login();
|
// await login();
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ export const GeneralPage = ({ workspace }: { workspace: WorkspaceInfo }) => {
|
|||||||
};
|
};
|
||||||
const handleUpdateWorkspaceName = () => {
|
const handleUpdateWorkspaceName = () => {
|
||||||
console.log('currentWorkspace: ', currentWorkspace);
|
console.log('currentWorkspace: ', currentWorkspace);
|
||||||
|
currentWorkspace &&
|
||||||
updateWorkspace({ name: workspaceName }, currentWorkspace);
|
updateWorkspace({ name: workspaceName }, currentWorkspace);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -49,7 +50,7 @@ export const GeneralPage = ({ workspace }: { workspace: WorkspaceInfo }) => {
|
|||||||
// console.log('file: ', file);
|
// console.log('file: ', file);
|
||||||
// setUploading(true);
|
// setUploading(true);
|
||||||
const blob = new Blob([file], { type: file.type });
|
const blob = new Blob([file], { type: file.type });
|
||||||
updateWorkspace({ avatarBlob: blob }, currentWorkspace);
|
currentWorkspace && updateWorkspace({ avatarBlob: blob }, currentWorkspace);
|
||||||
};
|
};
|
||||||
|
|
||||||
return workspace ? (
|
return workspace ? (
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const Page: NextPageWithLayout = () => {
|
|||||||
<EditorHeader />
|
<EditorHeader />
|
||||||
<MobileModal />
|
<MobileModal />
|
||||||
|
|
||||||
{currentPage && (
|
{currentPage && currentWorkspace && (
|
||||||
<DynamicBlocksuite
|
<DynamicBlocksuite
|
||||||
page={currentPage}
|
page={currentPage}
|
||||||
workspace={currentWorkspace}
|
workspace={currentWorkspace}
|
||||||
|
|||||||
Reference in New Issue
Block a user