fix catalog filter count per subplebbit address

This commit is contained in:
Tom (plebeius.eth)
2025-03-06 17:24:56 +01:00
parent 5d527089c6
commit 0faaa4982a
2 changed files with 66 additions and 3 deletions
@@ -5,7 +5,7 @@ import styles from './catalog-filters.module.css';
const FiltersTable = ({ onSave }: { onSave: () => void }) => {
const { t } = useTranslation();
const { filterItems, saveAndApplyFilters } = useCatalogFiltersStore();
const { filterItems, saveAndApplyFilters, currentSubplebbitAddress } = useCatalogFiltersStore();
const [localFilterItems, setLocalFilterItems] = useState(
filterItems.map((item) => ({
@@ -127,7 +127,9 @@ const FiltersTable = ({ onSave }: { onSave: () => void }) => {
×
</span>
</td>
<td className={styles.filterHits}>{item.count > 0 && `x${item.count}`}</td>
<td className={styles.filterHits}>
{currentSubplebbitAddress && (item.subplebbitCounts?.get(currentSubplebbitAddress) ?? 0) > 0 && `x${item.subplebbitCounts?.get(currentSubplebbitAddress)}`}
</td>
</tr>
))}
</tbody>