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> <div>
{recentlyViewed.length > 0 && ( {recentlyViewed.length > 0 && (
<Command.Group heading={t('Recent')}> <Command.Group heading={t('Recent')}>
{recentlyViewed.map(recent => { {recentlyViewed
return ( .filter(
<Command.Item recent =>
key={recent.id} pageList.find(page => recent.id === page.id)?.trash !== true
value={recent.id} )
onSelect={() => { .map(recent => {
onClose(); return (
jumpToPage(blockSuiteWorkspace.id, recent.id); <Command.Item
}} key={recent.id}
> value={recent.id}
<StyledListItem> onSelect={() => {
{recent.mode === 'edgeless' ? ( onClose();
<EdgelessIcon /> jumpToPage(blockSuiteWorkspace.id, recent.id);
) : ( }}
<PaperIcon /> >
)} <StyledListItem>
<span>{recent.title}</span> {recent.mode === 'edgeless' ? (
</StyledListItem> <EdgelessIcon />
</Command.Item> ) : (
); <PaperIcon />
})} )}
<span>{recent.title}</span>
</StyledListItem>
</Command.Item>
);
})}
</Command.Group> </Command.Group>
)} )}