change all filters to functions

This commit is contained in:
Esteban Abaroa
2023-09-09 18:43:16 +00:00
parent 6627e0615a
commit f006f7018c
4 changed files with 14 additions and 23 deletions
+4 -6
View File
@@ -260,14 +260,12 @@ const Subscriptions = () => {
const allParentCids = useMemo(() => {
const allRepliesCids = Object.values(flattenedRepliesByThread).flatMap(replies => replies.map(reply => reply.cid));
const allThreadCids = selectedFeed.map(thread => thread.cid);
return [...allThreadCids, ...allRepliesCids];
return new Set([...allThreadCids, ...allRepliesCids]);
}, [flattenedRepliesByThread, selectedFeed]);
const filter = useMemo(() => ({
parentCids: allParentCids
}), [allParentCids]);
const filter = useCallback((accountComment) => allParentCids.has(accountComment.parentCid), [allParentCids]);
const { accountComments } = useAccountComments({ filter });