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 || []);
}, [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
useEffect(() => {
const newCidTracker = {};
@@ -721,10 +714,15 @@ const All = () => {
{feed ? (
<Virtuoso
increaseViewportBy={{bottom: 600, top: 600}}
data={filteredFeed}
data={selectedFeed}
itemContent={(index, thread) => {
if (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 commentMediaInfo = getCommentMediaInfo(thread);
+6 -8
View File
@@ -340,13 +340,6 @@ const Board = () => {
return selectedFeed.flatMap(thread => filteredRepliesByThread[thread.cid]?.displayedReplies || []);
}, [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
useEffect(() => {
const newCidTracker = {};
@@ -1636,10 +1629,15 @@ const Board = () => {
: null}
<Virtuoso
increaseViewportBy={{bottom: 600, top: 600}}
data={filteredFeed}
data={selectedFeed}
itemContent={(index, thread) => {
if (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 commentMediaInfo = getCommentMediaInfo(thread);
+6 -8
View File
@@ -333,13 +333,6 @@ const Subscriptions = () => {
return selectedFeed.flatMap(thread => filteredRepliesByThread[thread.cid]?.displayedReplies || []);
}, [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
useEffect(() => {
const newCidTracker = {};
@@ -729,10 +722,15 @@ const Subscriptions = () => {
) : (
<Virtuoso
increaseViewportBy={{bottom: 600, top: 600}}
data={filteredFeed}
data={selectedFeed}
itemContent={(index, thread) => {
if (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 commentMediaInfo = getCommentMediaInfo(thread);