mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-03 19:58:56 +02:00
chore: select the global error container via firstElementChild
Addresses review feedback: `firstChild` could return a leading text node; `firstElementChild` reliably selects the wrapper `<div>`. Assisted-by: claude-code:opus-4.8
This commit is contained in:
@@ -24,7 +24,7 @@ export function showGlobalErrorMessage(msg: string, msgType: Intent = 'error', d
|
||||
if (!msgContainer) {
|
||||
const el = document.createElement('div');
|
||||
el.innerHTML = html`<div class="ui container js-global-error tw-my-[--page-spacing]"><details class="ui ${msgType} message"><summary></summary></details></div>`;
|
||||
msgContainer = el.firstChild as HTMLDivElement;
|
||||
msgContainer = el.firstElementChild as HTMLDivElement;
|
||||
}
|
||||
|
||||
// merge duplicated messages into "the message (count)" format
|
||||
|
||||
Reference in New Issue
Block a user