Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion web_src/js/features/repo-issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ export function initRepoIssueCommentDelete() {
const response = await POST($this.data('url'));
if (!response.ok) throw new Error('Failed to delete comment');
const $conversationHolder = $this.closest('.conversation-holder');

const $parentTimelineItem = $this.closest('.timeline-item');
const $parentTimelineGroup = $this.closest('.timeline-item-group');
// Check if this was a pending comment.
if ($conversationHolder.find('.pending-label').length) {
const $counter = $('#review-box .review-comments-counter');
Expand All @@ -185,6 +186,13 @@ export function initRepoIssueCommentDelete() {
}
$conversationHolder.remove();
}
// Check if there is no review content, move the avatar upward to avoid blocking the content below.
if (!$parentTimelineItem.find('.conversation-holder').length) {
const $timelineAvatar = $parentTimelineGroup.find('.timeline-avatar').eq(0);
if ($timelineAvatar.hasClass('timeline-avatar-offset')) {
$timelineAvatar.removeClass('timeline-avatar-offset');
}
}
} catch (error) {
console.error(error);
}
Expand Down