mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix popup not respecting <null> for text
This commit is contained in:
@@ -73,8 +73,8 @@ const showPopupHelper = {
|
|||||||
/**
|
/**
|
||||||
* Asynchronously displays an input popup with the given header and text, and returns the user's input.
|
* Asynchronously displays an input popup with the given header and text, and returns the user's input.
|
||||||
*
|
*
|
||||||
* @param {string} header - The header text for the popup.
|
* @param {string?} header - The header text for the popup.
|
||||||
* @param {string} text - The main text for the popup.
|
* @param {string?} text - The main text for the popup.
|
||||||
* @param {string} [defaultValue=''] - The default value for the input field.
|
* @param {string} [defaultValue=''] - The default value for the input field.
|
||||||
* @param {PopupOptions} [popupOptions={}] - Options for the popup.
|
* @param {PopupOptions} [popupOptions={}] - Options for the popup.
|
||||||
* @return {Promise<string?>} A Promise that resolves with the user's input.
|
* @return {Promise<string?>} A Promise that resolves with the user's input.
|
||||||
@@ -591,15 +591,15 @@ class PopupUtils {
|
|||||||
/**
|
/**
|
||||||
* Builds popup content with header and text below
|
* Builds popup content with header and text below
|
||||||
*
|
*
|
||||||
* @param {string} header - The header to be added to the text
|
* @param {string?} header - The header to be added to the text
|
||||||
* @param {string} text - The main text content
|
* @param {string?} text - The main text content
|
||||||
*/
|
*/
|
||||||
static BuildTextWithHeader(header, text) {
|
static BuildTextWithHeader(header, text) {
|
||||||
if (!header) {
|
if (!header) {
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
return `<h3>${header}</h3>
|
return `<h3>${header}</h3>
|
||||||
${text}`;
|
${text ?? ''}`; // Convert no text to empty string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user