1
0
Fork 0
forked from forgejo/forgejo

Improve reviewing PR UX (#19612)

This commit is contained in:
Gusted 2022-05-07 05:35:12 +00:00 committed by GitHub
parent 5a9c505e14
commit 0eac09e066
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 74 additions and 3 deletions

View file

@ -160,6 +160,16 @@ export function initRepoIssueCommentDelete() {
_csrf: csrfToken,
}).done(() => {
const $conversationHolder = $this.closest('.conversation-holder');
// Check if this was a pending comment.
if ($conversationHolder.find('.pending-label').length) {
const $counter = $('#review-box .review-comments-counter');
let num = parseInt($counter.attr('data-pending-comment-number')) - 1 || 0;
num = Math.max(num, 0);
$counter.attr('data-pending-comment-number', num);
$counter.text(num);
}
$(`#${$this.data('comment-id')}`).remove();
if ($conversationHolder.length && !$conversationHolder.find('.comment').length) {
const path = $conversationHolder.data('path');