remove feed filter for edits

This commit is contained in:
plebeius.eth
2023-09-16 18:18:37 +02:00
parent e8b42786e1
commit b6f21f0034
3 changed files with 18 additions and 24 deletions
+6 -8
View File
@@ -332,13 +332,6 @@ const All = () => {
return selectedFeed.flatMap(thread => filteredRepliesByThread[thread.cid]?.displayedReplies || []); return selectedFeed.flatMap(thread => filteredRepliesByThread[thread.cid]?.displayedReplies || []);
}, [selectedFeed, filteredRepliesByThread]); }, [selectedFeed, filteredRepliesByThread]);
const filteredFeed = useMemo(() => {
return selectedFeed.filter(thread => {
const editedThread = editedComments[thread.cid];
return !(editedThread && editedThread.removed);
});
}, [selectedFeed, editedComments]);
// let post.jsx access full cid of user-typed short cid // let post.jsx access full cid of user-typed short cid
useEffect(() => { useEffect(() => {
const newCidTracker = {}; const newCidTracker = {};
@@ -721,10 +714,15 @@ const All = () => {
{feed ? ( {feed ? (
<Virtuoso <Virtuoso
increaseViewportBy={{bottom: 600, top: 600}} increaseViewportBy={{bottom: 600, top: 600}}
data={filteredFeed} data={selectedFeed}
itemContent={(index, thread) => { itemContent={(index, thread) => {
if (editedComments[thread.cid]) { if (editedComments[thread.cid]) {
thread = editedComments[thread.cid]; thread = editedComments[thread.cid];
if (thread.removed) {
thread.content = "[removed]";
thread.link = undefined;
thread.title = "[removed]";
}
}; };
const { displayedReplies, omittedCount } = filteredRepliesByThread[thread.cid] || {}; const { displayedReplies, omittedCount } = filteredRepliesByThread[thread.cid] || {};
const commentMediaInfo = getCommentMediaInfo(thread); const commentMediaInfo = getCommentMediaInfo(thread);
+6 -8
View File
@@ -340,13 +340,6 @@ const Board = () => {
return selectedFeed.flatMap(thread => filteredRepliesByThread[thread.cid]?.displayedReplies || []); return selectedFeed.flatMap(thread => filteredRepliesByThread[thread.cid]?.displayedReplies || []);
}, [selectedFeed, filteredRepliesByThread]); }, [selectedFeed, filteredRepliesByThread]);
const filteredFeed = useMemo(() => {
return selectedFeed.filter(thread => {
const editedThread = editedComments[thread.cid];
return !(editedThread && editedThread.removed);
});
}, [selectedFeed, editedComments]);
// let post.jsx access full cid of user-typed short cid // let post.jsx access full cid of user-typed short cid
useEffect(() => { useEffect(() => {
const newCidTracker = {}; const newCidTracker = {};
@@ -1636,10 +1629,15 @@ const Board = () => {
: null} : null}
<Virtuoso <Virtuoso
increaseViewportBy={{bottom: 600, top: 600}} increaseViewportBy={{bottom: 600, top: 600}}
data={filteredFeed} data={selectedFeed}
itemContent={(index, thread) => { itemContent={(index, thread) => {
if (editedComments[thread.cid]) { if (editedComments[thread.cid]) {
thread = editedComments[thread.cid]; thread = editedComments[thread.cid];
if (thread.removed) {
thread.content = "[removed]";
thread.link = undefined;
thread.title = "[removed]";
}
}; };
const { displayedReplies, omittedCount } = filteredRepliesByThread[thread.cid] || {}; const { displayedReplies, omittedCount } = filteredRepliesByThread[thread.cid] || {};
const commentMediaInfo = getCommentMediaInfo(thread); const commentMediaInfo = getCommentMediaInfo(thread);
+6 -8
View File
@@ -333,13 +333,6 @@ const Subscriptions = () => {
return selectedFeed.flatMap(thread => filteredRepliesByThread[thread.cid]?.displayedReplies || []); return selectedFeed.flatMap(thread => filteredRepliesByThread[thread.cid]?.displayedReplies || []);
}, [selectedFeed, filteredRepliesByThread]); }, [selectedFeed, filteredRepliesByThread]);
const filteredFeed = useMemo(() => {
return selectedFeed.filter(thread => {
const editedThread = editedComments[thread.cid];
return !(editedThread && editedThread.removed);
});
}, [selectedFeed, editedComments]);
// let post.jsx access full cid of user-typed short cid // let post.jsx access full cid of user-typed short cid
useEffect(() => { useEffect(() => {
const newCidTracker = {}; const newCidTracker = {};
@@ -729,10 +722,15 @@ const Subscriptions = () => {
) : ( ) : (
<Virtuoso <Virtuoso
increaseViewportBy={{bottom: 600, top: 600}} increaseViewportBy={{bottom: 600, top: 600}}
data={filteredFeed} data={selectedFeed}
itemContent={(index, thread) => { itemContent={(index, thread) => {
if (editedComments[thread.cid]) { if (editedComments[thread.cid]) {
thread = editedComments[thread.cid]; thread = editedComments[thread.cid];
if (thread.removed) {
thread.content = "[removed]";
thread.link = undefined;
thread.title = "[removed]";
}
}; };
const { displayedReplies, omittedCount } = filteredRepliesByThread[thread.cid] || {}; const { displayedReplies, omittedCount } = filteredRepliesByThread[thread.cid] || {};
const commentMediaInfo = getCommentMediaInfo(thread); const commentMediaInfo = getCommentMediaInfo(thread);