fix(core): deleted doc should not appear in tag pages (#8143)

close AF-1206
This commit is contained in:
JimmFly 2024-09-06 10:40:02 +00:00
parent 7fe8d7e96f
commit e822bbd2dd
No known key found for this signature in database
GPG Key ID: 126E0320FEB0D05C
2 changed files with 5 additions and 3 deletions

View File

@ -13,7 +13,6 @@ import * as styles from './tag-list-item.css';
const TagListTitleCell = ({
title,
pageCount,
}: Pick<TagListItemProps, 'title' | 'pageCount'>) => {
const t = useI18n();
return (
@ -24,12 +23,13 @@ const TagListTitleCell = ({
>
{title || t['Untitled']()}
</div>
{/* //TODO(@EYHN): when indexer is ready, add this back
<div
data-testid="page-list-item-preview-text"
className={styles.titleCellPreview}
>
{` · ${t['com.affine.tags.count']({ count: pageCount || 0 })}`}
</div>
</div> */}
</div>
);
};

View File

@ -37,7 +37,9 @@ export const TagDetail = ({ tagId }: { tagId?: string }) => {
const filteredPageMetas = useMemo(() => {
const pageIdsSet = new Set(pageIds);
return pageMetas.filter(page => pageIdsSet.has(page.id));
return pageMetas
.filter(page => pageIdsSet.has(page.id))
.filter(page => !page.trash);
}, [pageIds, pageMetas]);
const isActiveView = useIsActiveView();