mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix: remove unused variables from catalog and post views
- catalog.tsx: Remove unused 'coloredFeed' variable assignment in useMemo - post.tsx: Remove unused 'useState' import The useMemo in catalog.tsx still executes its side effects (applying filter colors to the store) without needing to assign the return value.
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user