Don't pre-render PM error if empty

This commit is contained in:
Cohee 2024-05-29 17:23:37 +03:00
parent 097894308e
commit b904f501ba

View File

@ -1348,11 +1348,11 @@ class PromptManager {
const promptManagerDiv = this.containerElement; const promptManagerDiv = this.containerElement;
promptManagerDiv.innerHTML = ''; promptManagerDiv.innerHTML = '';
const errorDiv = ` const errorDiv = this.error ? `
<div class="${this.configuration.prefix}prompt_manager_error"> <div class="${this.configuration.prefix}prompt_manager_error">
<span class="fa-solid tooltip fa-triangle-exclamation text_danger"></span> ${DOMPurify.sanitize(this.error)} <span class="fa-solid tooltip fa-triangle-exclamation text_danger"></span> ${DOMPurify.sanitize(this.error)}
</div> </div>
`; ` : '';
const totalActiveTokens = this.tokenUsage; const totalActiveTokens = this.tokenUsage;