build: enhance nx build (#2948)

This commit is contained in:
Alex Yang
2023-07-01 01:17:31 +08:00
committed by GitHub
parent 7a5a5d503a
commit 81c5e6d3d2
27 changed files with 559 additions and 138 deletions

View File

@@ -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
);