Merge pull request #228 from plebbit/master

Development
This commit is contained in:
plebeius.eth
2023-09-09 21:26:31 +02:00
committed by GitHub
6 changed files with 20 additions and 29 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
"@capacitor/android": "3.6.0", "@capacitor/android": "3.6.0",
"@capacitor/app": "1.1.1", "@capacitor/app": "1.1.1",
"@capacitor/core": "3.6.0", "@capacitor/core": "3.6.0",
"@plebbit/plebbit-react-hooks": "https://github.com/plebbit/plebbit-react-hooks.git#55b6e1dc3f11f19fb0b71f5770909d7904cb29c0", "@plebbit/plebbit-react-hooks": "https://github.com/plebbit/plebbit-react-hooks.git#5aef9d028f25fbe3db6fe748df0841f970e39f63",
"@testing-library/dom": "9.0.1", "@testing-library/dom": "9.0.1",
"@testing-library/jest-dom": "5.14.1", "@testing-library/jest-dom": "5.14.1",
"@testing-library/react": "14.0.0", "@testing-library/react": "14.0.0",
+2 -4
View File
@@ -259,13 +259,11 @@ const All = () => {
const allParentCids = useMemo(() => { const allParentCids = useMemo(() => {
const allRepliesCids = Object.values(flattenedRepliesByThread).flatMap(replies => replies.map(reply => reply.cid)); const allRepliesCids = Object.values(flattenedRepliesByThread).flatMap(replies => replies.map(reply => reply.cid));
const allThreadCids = selectedFeed.map(thread => thread.cid); const allThreadCids = selectedFeed.map(thread => thread.cid);
return [...allThreadCids, ...allRepliesCids]; return new Set([...allThreadCids, ...allRepliesCids]);
}, [flattenedRepliesByThread, selectedFeed]); }, [flattenedRepliesByThread, selectedFeed]);
const filter = useMemo(() => ({ const filter = useCallback((accountComment) => allParentCids.has(accountComment.parentCid), [allParentCids]);
parentCids: allParentCids
}), [allParentCids]);
const { accountComments } = useAccountComments({ filter }); const { accountComments } = useAccountComments({ filter });
+2 -4
View File
@@ -268,13 +268,11 @@ const Board = () => {
const allParentCids = useMemo(() => { const allParentCids = useMemo(() => {
const allRepliesCids = Object.values(flattenedRepliesByThread).flatMap(replies => replies.map(reply => reply.cid)); const allRepliesCids = Object.values(flattenedRepliesByThread).flatMap(replies => replies.map(reply => reply.cid));
const allThreadCids = selectedFeed.map(thread => thread.cid); const allThreadCids = selectedFeed.map(thread => thread.cid);
return [...allThreadCids, ...allRepliesCids]; return new Set([...allThreadCids, ...allRepliesCids]);
}, [flattenedRepliesByThread, selectedFeed]); }, [flattenedRepliesByThread, selectedFeed]);
const filter = useMemo(() => ({ const filter = useCallback((accountComment) => allParentCids.has(accountComment.parentCid), [allParentCids]);
parentCids: allParentCids
}), [allParentCids]);
const { accountComments } = useAccountComments({ filter }); const { accountComments } = useAccountComments({ filter });
+2 -4
View File
@@ -260,13 +260,11 @@ const Subscriptions = () => {
const allParentCids = useMemo(() => { const allParentCids = useMemo(() => {
const allRepliesCids = Object.values(flattenedRepliesByThread).flatMap(replies => replies.map(reply => reply.cid)); const allRepliesCids = Object.values(flattenedRepliesByThread).flatMap(replies => replies.map(reply => reply.cid));
const allThreadCids = selectedFeed.map(thread => thread.cid); const allThreadCids = selectedFeed.map(thread => thread.cid);
return [...allThreadCids, ...allRepliesCids]; return new Set([...allThreadCids, ...allRepliesCids]);
}, [flattenedRepliesByThread, selectedFeed]); }, [flattenedRepliesByThread, selectedFeed]);
const filter = useMemo(() => ({ const filter = useCallback((accountComment) => allParentCids.has(accountComment.parentCid), [allParentCids]);
parentCids: allParentCids
}), [allParentCids]);
const { accountComments } = useAccountComments({ filter }); const { accountComments } = useAccountComments({ filter });
+2 -5
View File
@@ -250,11 +250,8 @@ const Thread = () => {
); );
const filter = useMemo(() => ({ const threadAndRepliesCids = useMemo(() => new Set([(selectedThread || 'n/a'), ...flattenedReplies.map(reply => reply.cid)]), [selectedThread, flattenedReplies]);
parentCids: [ const filter = useCallback((accountComment) => threadAndRepliesCids.has(accountComment.parentCid), [threadAndRepliesCids]);
selectedThread || 'n/a', ...flattenedReplies.map(reply => reply.cid)
]
}), [flattenedReplies, selectedThread]);
const { accountComments } = useAccountComments({filter}); const { accountComments } = useAccountComments({filter});
+5 -5
View File
@@ -2662,9 +2662,9 @@
mkdirp "^1.0.4" mkdirp "^1.0.4"
rimraf "^3.0.2" rimraf "^3.0.2"
"@plebbit/plebbit-js@https://github.com/plebbit/plebbit-js.git#d45a63f7a23e44cd940419124ccb53754db2f14b": "@plebbit/plebbit-js@https://github.com/plebbit/plebbit-js.git#a68905109591f81c996514dd548af5cb25c4b9d2":
version "0.0.3" version "0.0.3"
resolved "https://github.com/plebbit/plebbit-js.git#d45a63f7a23e44cd940419124ccb53754db2f14b" resolved "https://github.com/plebbit/plebbit-js.git#a68905109591f81c996514dd548af5cb25c4b9d2"
dependencies: dependencies:
"@ensdomains/eth-ens-namehash" "2.0.15" "@ensdomains/eth-ens-namehash" "2.0.15"
"@keyv/sqlite" "3.6.2" "@keyv/sqlite" "3.6.2"
@@ -2723,11 +2723,11 @@
dependencies: dependencies:
debug "4.3.3" debug "4.3.3"
"@plebbit/plebbit-react-hooks@https://github.com/plebbit/plebbit-react-hooks.git#55b6e1dc3f11f19fb0b71f5770909d7904cb29c0": "@plebbit/plebbit-react-hooks@https://github.com/plebbit/plebbit-react-hooks.git#5aef9d028f25fbe3db6fe748df0841f970e39f63":
version "0.0.1" version "0.0.1"
resolved "https://github.com/plebbit/plebbit-react-hooks.git#55b6e1dc3f11f19fb0b71f5770909d7904cb29c0" resolved "https://github.com/plebbit/plebbit-react-hooks.git#5aef9d028f25fbe3db6fe748df0841f970e39f63"
dependencies: dependencies:
"@plebbit/plebbit-js" "https://github.com/plebbit/plebbit-js.git#d45a63f7a23e44cd940419124ccb53754db2f14b" "@plebbit/plebbit-js" "https://github.com/plebbit/plebbit-js.git#a68905109591f81c996514dd548af5cb25c4b9d2"
"@plebbit/plebbit-logger" "https://github.com/plebbit/plebbit-logger.git" "@plebbit/plebbit-logger" "https://github.com/plebbit/plebbit-logger.git"
assert "2.0.0" assert "2.0.0"
ethers "5.6.9" ethers "5.6.9"