Skip to content

Commit 8ab05a0

Browse files
committed
Apply code suggestion of wxiaoguang
1 parent e574f78 commit 8ab05a0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

web_src/js/features/repo-issue-content.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,11 @@ function showContentHistoryMenu(issueBaseUrl, $item, commentId) {
106106

107107
export function initRepoIssueContentHistory() {
108108
const issueIndex = $('#issueIndex').val();
109-
const $itemIssue = $('.timeline-item.comment.first');
110-
const $comments = $('.comment');
111-
if (!issueIndex || !$comments.length) return;
109+
if (!issueIndex) return;
110+
111+
const $itemIssue = $('.repository.issue .timeline-item.comment.first'); // issue(PR) main content
112+
const $comments = $('.repository.issue .comment-list .comment'); // includes: issue(PR) comments, code rerview comments
113+
if (!$itemIssue.length && !$comments.length) return;
112114

113115
const repoLink = $('#repolink').val();
114116
const issueBaseUrl = `${appSubUrl}/${repoLink}/issues/${issueIndex}`;

0 commit comments

Comments
 (0)