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
+2 -5
View File
@@ -242,11 +242,8 @@ const Thread = () => {
);
const filter = useMemo(() => ({
parentCids: [
selectedThread || 'n/a', ...flattenedReplies.map(reply => reply.cid)
]
}), [flattenedReplies, selectedThread]);
const threadAndRepliesCids = useMemo(() => new Set([(selectedThread || 'n/a'), ...flattenedReplies.map(reply => reply.cid)]), [selectedThread, flattenedReplies]);
const filter = useCallback((accountComment) => threadAndRepliesCids.has(accountComment.parentCid), [threadAndRepliesCids]);
const { accountComments } = useAccountComments({filter});