mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
build: enhance nx build (#2948)
This commit is contained in:
@@ -102,6 +102,7 @@ export const RootAppSidebar = ({
|
||||
const t = useAFFiNEI18N();
|
||||
const onClickNewPage = useCallback(async () => {
|
||||
const page = createPage();
|
||||
await page.waitForLoaded();
|
||||
openPage(page.id);
|
||||
}, [createPage, openPage]);
|
||||
|
||||
|
||||
@@ -282,14 +282,27 @@ export const WorkspaceLayoutInner: FC<PropsWithChildren> = ({ children }) => {
|
||||
currentWorkspace.blockSuiteWorkspace.meta._proxy.isEmpty = false;
|
||||
if (!router.query.pageId) {
|
||||
setCurrentPageId(pageId);
|
||||
jumpToPage(currentWorkspace.id, pageId).catch(err => {
|
||||
console.error(err);
|
||||
});
|
||||
jumpToPage(currentWorkspace.id, pageId).catch(console.error);
|
||||
}
|
||||
}
|
||||
}
|
||||
//#endregion
|
||||
|
||||
if (currentPageId) {
|
||||
const pageExist =
|
||||
currentWorkspace.blockSuiteWorkspace.getPage(currentPageId);
|
||||
if (router.pathname === '/[workspaceId]/[pageId]' && !pageExist) {
|
||||
router.push('/404').catch(console.error);
|
||||
}
|
||||
} else if (
|
||||
router.pathname === '/[workspaceId]/[pageId]' &&
|
||||
typeof router.query.pageId === 'string' &&
|
||||
router.query.pageId !== currentPageId
|
||||
) {
|
||||
setCurrentPageId(router.query.pageId);
|
||||
jumpToPage(currentWorkspace.id, router.query.pageId).catch(console.error);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const backgroundProviders =
|
||||
currentWorkspace.blockSuiteWorkspace.providers.filter(
|
||||
@@ -307,9 +320,6 @@ export const WorkspaceLayoutInner: FC<PropsWithChildren> = ({ children }) => {
|
||||
}, [currentWorkspace]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!currentWorkspace) {
|
||||
return;
|
||||
}
|
||||
const page = currentWorkspace.blockSuiteWorkspace.getPage(
|
||||
DEFAULT_HELLO_WORLD_PAGE_ID
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user