aboutsummaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-05-16 21:04:25 +0800
committerGitHub <noreply@github.com>2024-05-16 13:04:25 +0000
commit740b6e1389911eeea860cfccd4bad218fe33f3bd (patch)
treed4cab880e720f010382ebd70434e7b51e793fe24 /web_src
parent2611249511aaab710ad7b0bccd049d3e4dc912f4 (diff)
downloadgitea-740b6e1389911eeea860cfccd4bad218fe33f3bd.tar.gz
gitea-740b6e1389911eeea860cfccd4bad218fe33f3bd.zip
Fix JS error when editing a merged PR's title (#30990)
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/features/repo-issue.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js
index 8ee681aedc..519db34934 100644
--- a/web_src/js/features/repo-issue.js
+++ b/web_src/js/features/repo-issue.js
@@ -626,9 +626,12 @@ export function initRepoIssueTitleEdit() {
showElem(issueTitleDisplay);
showElem('#pull-desc-display');
});
+
+ const pullDescEditor = document.querySelector('#pull-desc-editor'); // it may not exist for a merged PR
+ const prTargetUpdateUrl = pullDescEditor?.getAttribute('data-target-update-url');
+
const editSaveButton = issueTitleEditor.querySelector('.ui.primary.button');
editSaveButton.addEventListener('click', async () => {
- const prTargetUpdateUrl = editSaveButton.getAttribute('data-target-update-url');
const newTitle = issueTitleInput.value.trim();
try {
if (newTitle && newTitle !== oldTitle) {