Don't pop up the error modal for connecting/status messages.

This commit is contained in:
Cory McWilliams 2024-04-18 12:46:06 -04:00
parent 96037d4da6
commit bd14168627

View File

@ -344,12 +344,18 @@ class TfNavigationElement extends LitElement {
>🎛</a
>
${this.render_permissions()}
${this.status?.message && !this.status.is_error
? html`
<link type="text/css" rel="stylesheet" href="/static/w3.css" />
<div class="w3-bar-item" style="color: ${this.status.color ?? kStatusColor}">${this.status.message}</div>
`
: undefined}
${Object.keys(this.spark_lines)
.sort()
.map((x) => this.spark_lines[x])}
${this.render_login()} ${this.render_identity()}
</div>
${this.status.message
${this.status?.is_error
? html`
<link type="text/css" rel="stylesheet" href="/static/w3.css" />
<div class="w3-model w3-animate-top" style="position: absolute; left: 50%; transform: translate(-50%); z-index: 1">
@ -1105,9 +1111,9 @@ function api_postMessage(message) {
function api_error(error) {
if (error) {
if (typeof error == 'string') {
setStatusMessage('⚠️ ' + error, '#f00');
setStatusMessage('⚠️ ' + error, kErrorColor);
} else {
setStatusMessage('⚠️ ' + error.message + '\n' + error.stack, '#f00');
setStatusMessage('⚠️ ' + error.message + '\n' + error.stack, kErrorColor);
}
}
console.log('error', error);
@ -1324,6 +1330,7 @@ function setStatusMessage(message, color) {
document.getElementsByTagName('tf-navigation')[0].status = {
message: message,
color: color,
is_error: color == kErrorColor,
};
}