mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
update mod edit
This commit is contained in:
@@ -721,7 +721,6 @@ const All = () => {
|
||||
if (thread.removed) {
|
||||
thread.content = "[removed]";
|
||||
thread.link = undefined;
|
||||
thread.title = "[removed]";
|
||||
}
|
||||
};
|
||||
const { displayedReplies, omittedCount } = filteredRepliesByThread[thread.cid] || {};
|
||||
|
||||
@@ -1636,7 +1636,6 @@ const Board = () => {
|
||||
if (thread.removed) {
|
||||
thread.content = "[removed]";
|
||||
thread.link = undefined;
|
||||
thread.title = "[removed]";
|
||||
}
|
||||
};
|
||||
const { displayedReplies, omittedCount } = filteredRepliesByThread[thread.cid] || {};
|
||||
|
||||
@@ -729,7 +729,6 @@ const Subscriptions = () => {
|
||||
if (thread.removed) {
|
||||
thread.content = "[removed]";
|
||||
thread.link = undefined;
|
||||
thread.title = "[removed]";
|
||||
}
|
||||
};
|
||||
const { displayedReplies, omittedCount } = filteredRepliesByThread[thread.cid] || {};
|
||||
|
||||
@@ -56,6 +56,7 @@ const Thread = () => {
|
||||
setChallengesArray,
|
||||
defaultSubplebbits,
|
||||
editedComment,
|
||||
editedComments,
|
||||
setIsAuthorDelete,
|
||||
setIsAuthorEdit,
|
||||
setIsCaptchaOpen,
|
||||
@@ -134,9 +135,10 @@ const Thread = () => {
|
||||
|
||||
useAnonMode(selectedThread, anonymousMode && executeAnonMode);
|
||||
|
||||
const comment = useComment({commentCid: selectedThread});
|
||||
const originalComment = useComment({commentCid: selectedThread});
|
||||
const [comment, setComment] = useState(originalComment);
|
||||
const { subplebbitAddress, threadCid } = useParams();
|
||||
const subplebbit = useSubplebbit({subplebbitAddress: comment.subplebbitAddress});
|
||||
const subplebbit = useSubplebbit({subplebbitAddress: originalComment.subplebbitAddress});
|
||||
const selectedAddress = subplebbit.address;
|
||||
|
||||
const stateString = useStateString(comment);
|
||||
@@ -144,6 +146,22 @@ const Thread = () => {
|
||||
const commentMediaInfo = getCommentMediaInfo(comment);
|
||||
const fallbackImgUrl = "assets/filedeleted-res.gif";
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
let updatedComment = { ...originalComment };
|
||||
|
||||
if (editedComments[originalComment.cid]) {
|
||||
updatedComment = { ...originalComment, ...editedComments[originalComment.cid] };
|
||||
|
||||
if (updatedComment.removed) {
|
||||
updatedComment.content = "[removed]";
|
||||
updatedComment.link = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
setComment(updatedComment);
|
||||
}, [originalComment, editedComments]);
|
||||
|
||||
|
||||
const handleThumbnailClick = (index, type) => {
|
||||
switch(type) {
|
||||
@@ -1272,6 +1290,13 @@ const Thread = () => {
|
||||
</div>
|
||||
{comment.replyCount === undefined ? <PostLoader /> : null}
|
||||
{sortedReplies.map((reply, index) => {
|
||||
if (editedComments[reply.cid]) {
|
||||
reply = editedComments[reply.cid];
|
||||
if (reply.removed) {
|
||||
reply.content = "[removed]";
|
||||
reply.link = undefined;
|
||||
}
|
||||
}
|
||||
const replyMediaInfo = getCommentMediaInfo(reply);
|
||||
const fallbackImgUrl = "assets/filedeleted-res.gif";
|
||||
const shortParentCid = findShortParentCid(reply.parentCid, comment);
|
||||
|
||||
Reference in New Issue
Block a user