aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/features')
-rw-r--r--web_src/js/features/repo-issue-content.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/web_src/js/features/repo-issue-content.js b/web_src/js/features/repo-issue-content.js
index a2fc6c3cbe..602523f89d 100644
--- a/web_src/js/features/repo-issue-content.js
+++ b/web_src/js/features/repo-issue-content.js
@@ -106,8 +106,11 @@ function showContentHistoryMenu(issueBaseUrl, $item, commentId) {
export function initRepoIssueContentHistory() {
const issueIndex = $('#issueIndex').val();
- const $itemIssue = $('.timeline-item.comment.first');
- if (!issueIndex || !$itemIssue.length) return;
+ if (!issueIndex) return;
+
+ const $itemIssue = $('.repository.issue .timeline-item.comment.first'); // issue(PR) main content
+ const $comments = $('.repository.issue .comment-list .comment'); // includes: issue(PR) comments, code rerview comments
+ if (!$itemIssue.length && !$comments.length) return;
const repoLink = $('#repolink').val();
const issueBaseUrl = `${appSubUrl}/${repoLink}/issues/${issueIndex}`;
@@ -123,7 +126,7 @@ export function initRepoIssueContentHistory() {
i18nTextDeleteFromHistoryConfirm = resp.i18n.textDeleteFromHistoryConfirm;
i18nTextOptions = resp.i18n.textOptions;
- if (resp.editedHistoryCountMap[0]) {
+ if (resp.editedHistoryCountMap[0] && $itemIssue.length) {
showContentHistoryMenu(issueBaseUrl, $itemIssue, '0');
}
for (const [commentId, _editedCount] of Object.entries(resp.editedHistoryCountMap)) {