Fix popup not respecting <null> for text

63512c208f7e868d7e52bc3be650d52bd0fa4768

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +5 -5Showing whitespace changes
public/scripts/popup.js+5 -5
@@ -73,8 +73,8 @@ const showPopupHelper = {
73 /**73 /**
74 * Asynchronously displays an input popup with the given header and text, and returns the user's input.74 * Asynchronously displays an input popup with the given header and text, and returns the user's input.
75 *75 *
76 * @param {string} header - The header text for the popup.76 * @param {string?} header - The header text for the popup.
77 * @param {string} text - The main text for the popup.77 * @param {string?} text - The main text for the popup.
78 * @param {string} [defaultValue=''] - The default value for the input field.78 * @param {string} [defaultValue=''] - The default value for the input field.
79 * @param {PopupOptions} [popupOptions={}] - Options for the popup.79 * @param {PopupOptions} [popupOptions={}] - Options for the popup.
80 * @return {Promise<string?>} A Promise that resolves with the user's input.80 * @return {Promise<string?>} A Promise that resolves with the user's input.
@@ -591,15 +591,15 @@ class PopupUtils {
591 /**591 /**
592 * Builds popup content with header and text below592 * Builds popup content with header and text below
593 *593 *
594 * @param {string} header - The header to be added to the text594 * @param {string?} header - The header to be added to the text
595 * @param {string} text - The main text content595 * @param {string?} text - The main text content
596 */596 */
597 static BuildTextWithHeader(header, text) {597 static BuildTextWithHeader(header, text) {
598 if (!header) {598 if (!header) {
599 return text;599 return text;
600 }600 }
601 return `<h3>${header}</h3>601 return `<h3>${header}</h3>
602 ${text}`;602 ${text ?? ''}`; // Convert no text to empty string
603 }603 }
604}604}
605605