mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-05 08:19:48 +08:00
fix: deepscan error (#733)
This commit is contained in:
@@ -60,7 +60,7 @@ export const Editor = ({ page, workspace, setEditor }: Props) => {
|
||||
}
|
||||
|
||||
setEditor(editor);
|
||||
document.title = page?.meta.title || 'Untitled';
|
||||
document.title = page.meta.title || 'Untitled';
|
||||
return ret;
|
||||
}, [workspace, page, setEditor]);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ const Page: NextPageWithLayout = () => {
|
||||
p => p.id === router.query.pageId
|
||||
)
|
||||
) {
|
||||
const page = data.blocksuiteWorkspace?.getPage(
|
||||
const page = data.blocksuiteWorkspace.getPage(
|
||||
router.query.pageId as string
|
||||
);
|
||||
page && setPage(page);
|
||||
|
||||
@@ -101,14 +101,15 @@ export const AppStateProvider = ({
|
||||
}
|
||||
const workspace = (await dataCenter.loadWorkspace(workspaceId)) ?? null;
|
||||
let isOwner;
|
||||
if (workspace.provider === 'local') {
|
||||
if (workspace?.provider === 'local') {
|
||||
// isOwner is useful only in the cloud
|
||||
isOwner = true;
|
||||
} else {
|
||||
isOwner = workspace.owner && user?.id === workspace.owner.id;
|
||||
// We must ensure workspace.owner exists, then ensure id same.
|
||||
isOwner = workspace?.owner && user?.id === workspace.owner.id;
|
||||
}
|
||||
const pageList =
|
||||
(workspace.blocksuiteWorkspace?.meta.pageMetas as PageMeta[]) ?? [];
|
||||
(workspace?.blocksuiteWorkspace?.meta.pageMetas as PageMeta[]) ?? [];
|
||||
setAppState({
|
||||
...appState,
|
||||
currentWorkspace: workspace,
|
||||
|
||||
Reference in New Issue
Block a user