mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-07 14:17:18 +02:00
backport #38742
This commit is contained in:
1 parent
a8e80ebc23
commit
7fb9602961
1 file changed
+7
-1
@@ -80,7 +80,13 @@ export function initRepoPullMergeBox(el: HTMLElement) {
|
||||
return;
|
||||
}
|
||||
document.removeEventListener('visibilitychange', onVisibilityChange);
|
||||
const newElem = createElementFromHTML(await resp.text());
|
||||
|
||||
const respText = (await resp.text()).trim();
|
||||
if (!respText) {
|
||||
el.remove(); // merge box might not exist if the PR has changed (e.g.: merged and the head branch has been deleted)
|
||||
return;
|
||||
}
|
||||
const newElem = createElementFromHTML(respText);
|
||||
el.replaceWith(newElem);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user