Fix popup not respecting <null> for text

63512c208f7e868d7e52bc3be650d52bd0fa4768

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +5 -5Ignore whitespace
public/scripts/popup.js+5 -5
@@ -73,8 +73,8 @@ const showPopupHelper = {
7373 /**
7474 * Asynchronously displays an input popup with the given header and text, and returns the user's input.
7575 *
7676 * @param {string?} header - The header text for the popup.
7777 * @param {string?} text - The main text for the popup.
7878 * @param {string} [defaultValue=''] - The default value for the input field.
7979 * @param {PopupOptions} [popupOptions={}] - Options for the popup.
8080 * @return {Promise<string?>} A Promise that resolves with the user's input.
@@ -591,15 +591,15 @@ class PopupUtils {
591591 /**
592592 * Builds popup content with header and text below
593593 *
594594 * @param {string?} header - The header to be added to the text
595595 * @param {string?} text - The main text content
596596 */
597597 static BuildTextWithHeader(header, text) {
598598 if (!header) {
599599 return text;
600600 }
601601 return `<h3>${header}</h3>
602- ${text}`;
602+ ${text ?? ''}`; // Convert no text to empty string
603603 }
604604}
605605