diff --git a/src/views/catalog/catalog.tsx b/src/views/catalog/catalog.tsx index a8da37fb..efa9d511 100644 --- a/src/views/catalog/catalog.tsx +++ b/src/views/catalog/catalog.tsx @@ -461,8 +461,8 @@ const Catalog = () => { }; }, [clearMatchedFilters, subplebbitAddress]); - // Apply filter colors to posts when feed changes - const coloredFeed = useMemo(() => { + // Memoize filter color application to avoid redundant iterations + useMemo(() => { if (combinedFeed.length > 0 && filterItems.length > 0) { // Clear existing matched filters clearMatchedFilters(); @@ -482,7 +482,6 @@ const Catalog = () => { } }); } - return combinedFeed; }, [combinedFeed, filterItems, clearMatchedFilters]); return ( diff --git a/src/views/post/post.tsx b/src/views/post/post.tsx index 5fb7b3a1..c1ba138c 100644 --- a/src/views/post/post.tsx +++ b/src/views/post/post.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react'; +import { useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { Comment, Role, useComment, useEditedComment, useSubplebbit } from '@plebbit/plebbit-react-hooks'; import useSubplebbitsStore from '@plebbit/plebbit-react-hooks/dist/stores/subplebbits';