From d9234c4e2a926c13fba62c78527896994b79c535 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Tue, 18 Jun 2024 21:06:30 +0200 Subject: [PATCH] feat(catalog): apply filter for text-only threads to rules and description --- src/views/catalog/catalog.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/views/catalog/catalog.tsx b/src/views/catalog/catalog.tsx index 64ebb255..21cd2713 100644 --- a/src/views/catalog/catalog.tsx +++ b/src/views/catalog/catalog.tsx @@ -26,6 +26,7 @@ const useFeedRows = (columnCount: number, feed: any, isFeedLoaded: boolean, subp const { t } = useTranslation(); const { address, createdAt, description, rules, shortAddress, suggested, title } = subplebbit || {}; const { avatarUrl } = suggested || {}; + const { showTextOnlyThreads } = useCatalogFiltersStore(); const location = useLocation(); const isInAllView = isAllView(location.pathname, useParams()); @@ -35,11 +36,13 @@ const useFeedRows = (columnCount: number, feed: any, isFeedLoaded: boolean, subp if (!isFeedLoaded) { return []; // prevent rules and description from appearing while feed is loading } + if (!description && !rules && !isInAllView) { return feed; } + const _feed = [...feed]; - if ((description && description.length > 0) || isInAllView) { + if ((description && description.length > 0 && (showTextOnlyThreads || (!showTextOnlyThreads && suggested?.avatarUrl))) || isInAllView) { _feed.unshift({ isDescription: true, subplebbitAddress: address, @@ -52,7 +55,7 @@ const useFeedRows = (columnCount: number, feed: any, isFeedLoaded: boolean, subp locked: true, }); } - if (rules && rules.length > 0) { + if (rules && rules.length > 0 && showTextOnlyThreads) { _feed.unshift({ isRules: true, subplebbitAddress: address,