fix: ignore trash (#1426)

This commit is contained in:
Himself65
2023-03-08 18:07:37 -06:00
committed by GitHub
parent 0c811f1420
commit f459b07fa2

View File

@@ -93,27 +93,32 @@ export const Results: React.FC<ResultsProps> = ({
<div>
{recentlyViewed.length > 0 && (
<Command.Group heading={t('Recent')}>
{recentlyViewed.map(recent => {
return (
<Command.Item
key={recent.id}
value={recent.id}
onSelect={() => {
onClose();
jumpToPage(blockSuiteWorkspace.id, recent.id);
}}
>
<StyledListItem>
{recent.mode === 'edgeless' ? (
<EdgelessIcon />
) : (
<PaperIcon />
)}
<span>{recent.title}</span>
</StyledListItem>
</Command.Item>
);
})}
{recentlyViewed
.filter(
recent =>
pageList.find(page => recent.id === page.id)?.trash !== true
)
.map(recent => {
return (
<Command.Item
key={recent.id}
value={recent.id}
onSelect={() => {
onClose();
jumpToPage(blockSuiteWorkspace.id, recent.id);
}}
>
<StyledListItem>
{recent.mode === 'edgeless' ? (
<EdgelessIcon />
) : (
<PaperIcon />
)}
<span>{recent.title}</span>
</StyledListItem>
</Command.Item>
);
})}
</Command.Group>
)}