perf: eliminate redundant derived state in board and post views

This commit is contained in:
plebeius
2025-10-16 23:13:18 +02:00
parent d57bf88586
commit b10ada55e7
4 changed files with 48 additions and 48 deletions
+2 -1
View File
@@ -462,7 +462,7 @@ const Catalog = () => {
}, [clearMatchedFilters, subplebbitAddress]);
// Apply filter colors to posts when feed changes
useEffect(() => {
const coloredFeed = useMemo(() => {
if (combinedFeed.length > 0 && filterItems.length > 0) {
// Clear existing matched filters
clearMatchedFilters();
@@ -482,6 +482,7 @@ const Catalog = () => {
}
});
}
return combinedFeed;
}, [combinedFeed, filterItems, clearMatchedFilters]);
return (