Skip to content

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.

fix: move suspense to the correct place (#1954)

Himself6543a96fe8e348
diff --git a/apps/web/src/layouts/public-workspace-layout.tsx b/apps/web/src/layouts/public-workspace-layout.tsx
index 422153221b..c044ac86ca 100644
--- a/apps/web/src/layouts/public-workspace-layout.tsx
+++ b/apps/web/src/layouts/public-workspace-layout.tsx
@@ -1,4 +1,3 @@
-import { ListSkeleton } from '@affine/component';
import type { AffinePublicWorkspace } from '@affine/workspace/type';
import { useAtom } from 'jotai';
import Head from 'next/head';
@@ -7,7 +6,6 @@ import type React from 'react';
import { lazy, Suspense } from 'react';
import { openQuickSearchModalAtom } from '../atoms';
-import { StyledTableContainer } from '../components/blocksuite/block-suite-page-list/page-list/styles';
import { useRouterTitle } from '../hooks/use-router-title';
import { MainContainer, StyledPage } from './styles';
@@ -61,14 +59,6 @@ export const PublicWorkspaceLayout: React.FC<
React.PropsWithChildren
> = props => {
return (
- <Suspense
- fallback={
- <StyledTableContainer>
- <ListSkeleton />
- </StyledTableContainer>
- }
- >
- <PublicWorkspaceLayoutInner>{props.children}</PublicWorkspaceLayoutInner>
- </Suspense>
+ <PublicWorkspaceLayoutInner>{props.children}</PublicWorkspaceLayoutInner>
);
};
diff --git a/apps/web/src/pages/public-workspace/[workspaceId].tsx b/apps/web/src/pages/public-workspace/[workspaceId].tsx
index c5f55d3ff3..1ea6f17a9e 100644
--- a/apps/web/src/pages/public-workspace/[workspaceId].tsx
+++ b/apps/web/src/pages/public-workspace/[workspaceId].tsx
@@ -75,7 +75,13 @@ const ListPageInner: React.FC<{
<SearchIcon />
</IconButton>
</NavContainer>
- <Suspense>
+ <Suspense
+ fallback={
+ <StyledTableContainer>
+ <ListSkeleton />
+ </StyledTableContainer>
+ }
+ >
<BlockSuitePublicPageList
onOpenPage={handleClickPage}
blockSuiteWorkspace={blockSuiteWorkspace}