fix(publish): retry failed comments without duplicate replies

This commit is contained in:
Tommaso Casaburi
2026-04-10 16:02:10 +07:00
parent 02f8d3467e
commit 5f9e603b62
8 changed files with 385 additions and 17 deletions
+19 -4
View File
@@ -519,8 +519,15 @@ const Reply = ({
const route = boardPath ? `/${boardPath}/thread/${cid}` : `/thread/${cid}`;
const isRouteLinkToReply = cid ? location.pathname.startsWith(route) : false;
const { hidden } = useHide({ cid });
const { canDeleteFailedPost, isDeletingFailedPost, onDeleteFailedPost } = useDeleteFailedPost(post);
const failedPublishNotice = canDeleteFailedPost ? <FailedPublishNotice isDeleting={isDeletingFailedPost} onDelete={onDeleteFailedPost} /> : undefined;
const { canDeleteFailedPost, canRetryFailedPost, isDeletingFailedPost, isRetryingFailedPost, onDeleteFailedPost, onRetryFailedPost } = useDeleteFailedPost(post);
const failedPublishNotice = canDeleteFailedPost ? (
<FailedPublishNotice
isDeleting={isDeletingFailedPost}
isRetrying={isRetryingFailedPost}
onDelete={onDeleteFailedPost}
onRetry={canRetryFailedPost ? onRetryFailedPost : undefined}
/>
) : undefined;
return (
<div className={`${styles.replyMobile} ${disableDeferredLayout ? styles.pretextVirtualizedReply : ''}`}>
@@ -648,8 +655,16 @@ const PostMobile = ({
const stateString = useStateString(resolvedPost) || t('loading_post');
const hasFailedState = state === 'failed';
const isReply = !!parentCid;
const { canDeleteFailedPost, isDeletingFailedPost, onDeleteFailedPost } = useDeleteFailedPost(resolvedPost);
const failedPublishNotice = canDeleteFailedPost ? <FailedPublishNotice isDeleting={isDeletingFailedPost} onDelete={onDeleteFailedPost} /> : undefined;
const { canDeleteFailedPost, canRetryFailedPost, isDeletingFailedPost, isRetryingFailedPost, onDeleteFailedPost, onRetryFailedPost } =
useDeleteFailedPost(resolvedPost);
const failedPublishNotice = canDeleteFailedPost ? (
<FailedPublishNotice
isDeleting={isDeletingFailedPost}
isRetrying={isRetryingFailedPost}
onDelete={onDeleteFailedPost}
onRetry={canRetryFailedPost ? onRetryFailedPost : undefined}
/>
) : undefined;
// Author-deleted replies are hidden from thread replies; moderator removals still render their placeholder.
const filteredReplies = useMemo(() => filterRepliesForDisplay(freshRepliesForRender), [freshRepliesForRender]);