diff --git a/src/renderer/src/components/right-sidebar/checks-panel-content.tsx b/src/renderer/src/components/right-sidebar/checks-panel-content.tsx index 0ffc41dd686..84798c944f8 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel-content.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel-content.tsx @@ -1980,7 +1980,7 @@ function PRCommentGroupView({ presentation: PRCommentPresentationClasses onResolve?: (threadId: string, resolve: boolean) => boolean | Promise onStartReply?: (commentId: number) => void - onCancelReply?: () => void + onCancelReply?: (commentId: number) => void onReply?: (comment: PRComment, body: string) => Promise onEditComment?: (comment: PRComment, body: string) => Promise onDeleteComment?: (comment: PRComment) => void | Promise @@ -2001,7 +2001,7 @@ function PRCommentGroupView({ autoFocus disabled={replyDisabled} disabledReason={replyDisabledReason} - onCancel={onCancelReply} + onCancel={() => onCancelReply?.(comment.id)} onSubmit={(body) => onReply(comment, body)} /> @@ -2113,7 +2113,7 @@ function ResolvedCommentGroupsSection({ presentation: PRCommentPresentationClasses onResolve?: (threadId: string, resolve: boolean) => boolean | Promise onStartReply?: (commentId: number) => void - onCancelReply?: () => void + onCancelReply?: (commentId: number) => void onReply?: (comment: PRComment, body: string) => Promise onEditComment?: (comment: PRComment, body: string) => Promise onDeleteComment?: (comment: PRComment) => void | Promise @@ -2351,7 +2351,9 @@ export function PRCommentsList({ presentation={presentation} onResolve={onResolve} onStartReply={setReplyingCommentId} - onCancelReply={() => setReplyingCommentId(null)} + onCancelReply={(commentId) => + setReplyingCommentId((current) => (current === commentId ? null : current)) + } onReply={onReply} onEditComment={onEditComment} onDeleteComment={onDeleteComment} @@ -2679,7 +2681,9 @@ export function PRCommentsList({ presentation={presentation} onResolve={onResolve} onStartReply={setReplyingCommentId} - onCancelReply={() => setReplyingCommentId(null)} + onCancelReply={(commentId) => + setReplyingCommentId((current) => (current === commentId ? null : current)) + } onReply={onReply} onEditComment={onEditComment} onDeleteComment={onDeleteComment}