mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
fix: page crash in public workspace (#1324)
This commit is contained in:
@@ -30,7 +30,6 @@ export const BlockSuitePublicPageList: React.FC<BlockSuitePageListProps> = ({
|
||||
isPublic={true}
|
||||
blockSuiteWorkspace={blockSuiteWorkspace}
|
||||
onClickPage={onOpenPage}
|
||||
listType="all"
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -149,7 +149,7 @@ export const PageList: React.FC<PageListProps> = ({
|
||||
{pageMeta.title || t('Untitled')}
|
||||
</Content>
|
||||
</StyledTitleLink>
|
||||
{!isTrash && (
|
||||
{listType && !isTrash && (
|
||||
<FavoriteTag
|
||||
onClick={() => {
|
||||
helper.setPageMeta(pageMeta.id, {
|
||||
|
||||
@@ -20,12 +20,14 @@ import {
|
||||
export type BlockSuiteEditorHeaderProps = React.PropsWithChildren<{
|
||||
blockSuiteWorkspace: BlockSuiteWorkspace;
|
||||
pageId: string;
|
||||
isPublic?: boolean;
|
||||
}>;
|
||||
|
||||
export const BlockSuiteEditorHeader: React.FC<BlockSuiteEditorHeaderProps> = ({
|
||||
blockSuiteWorkspace,
|
||||
pageId,
|
||||
children,
|
||||
isPublic,
|
||||
}) => {
|
||||
const page = blockSuiteWorkspace.getPage(pageId);
|
||||
// fixme(himself65): remove this atom and move it to props
|
||||
@@ -43,7 +45,10 @@ export const BlockSuiteEditorHeader: React.FC<BlockSuiteEditorHeaderProps> = ({
|
||||
return (
|
||||
<Header
|
||||
rightItems={
|
||||
isTrash
|
||||
// fixme(himself65): other right items not supported in public mode
|
||||
isPublic
|
||||
? ['themeModeSwitch']
|
||||
: isTrash
|
||||
? ['trashButtonGroup']
|
||||
: ['syncUser', 'themeModeSwitch', 'editorOptionMenu']
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user