mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-03 09:04:17 +00:00
backport #38742
This commit is contained in:
@@ -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