diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-05-16 21:04:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 13:04:25 +0000 |
commit | 740b6e1389911eeea860cfccd4bad218fe33f3bd (patch) | |
tree | d4cab880e720f010382ebd70434e7b51e793fe24 /web_src | |
parent | 2611249511aaab710ad7b0bccd049d3e4dc912f4 (diff) | |
download | gitea-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.js | 5 |
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) { |