Fix the bug when the last code comment deleted, a review comment type comment is still in the activity list of the pull request

This commit is contained in:
Lunny Xiao
2025-07-20 12:32:07 -07:00
parent 86aafea3fb
commit 98f0ab2a1f
8 changed files with 116 additions and 15 deletions
+7
View File
@@ -150,6 +150,13 @@ export function initRepoIssueCommentDelete() {
counter.textContent = String(num);
}
const json: Record<string, any> = await response.json();
if (json.errorMessage) throw new Error(json.errorMessage);
if (json.deletedReviewCommentHashTag) {
document.querySelector(`#${json.deletedReviewCommentHashTag}`)?.remove();
}
document.querySelector(`#${deleteButton.getAttribute('data-comment-id')}`)?.remove();
if (conversationHolder && !conversationHolder.querySelector('.comment')) {