Don't pop up the error modal for connecting/status messages.
This commit is contained in:
		@@ -344,12 +344,18 @@ class TfNavigationElement extends LitElement {
 | 
				
			|||||||
					>🎛️</a
 | 
										>🎛️</a
 | 
				
			||||||
				>
 | 
									>
 | 
				
			||||||
				${this.render_permissions()}
 | 
									${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)
 | 
									${Object.keys(this.spark_lines)
 | 
				
			||||||
					.sort()
 | 
										.sort()
 | 
				
			||||||
					.map((x) => this.spark_lines[x])}
 | 
										.map((x) => this.spark_lines[x])}
 | 
				
			||||||
				${this.render_login()} ${this.render_identity()}
 | 
									${this.render_login()} ${this.render_identity()}
 | 
				
			||||||
			</div>
 | 
								</div>
 | 
				
			||||||
				${this.status.message
 | 
								${this.status?.is_error
 | 
				
			||||||
				? html`
 | 
									? html`
 | 
				
			||||||
					<link type="text/css" rel="stylesheet" href="/static/w3.css" />
 | 
										<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">
 | 
										<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) {
 | 
					function api_error(error) {
 | 
				
			||||||
	if (error) {
 | 
						if (error) {
 | 
				
			||||||
		if (typeof error == 'string') {
 | 
							if (typeof error == 'string') {
 | 
				
			||||||
			setStatusMessage('⚠️ ' + error, '#f00');
 | 
								setStatusMessage('⚠️ ' + error, kErrorColor);
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			setStatusMessage('⚠️ ' + error.message + '\n' + error.stack, '#f00');
 | 
								setStatusMessage('⚠️ ' + error.message + '\n' + error.stack, kErrorColor);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	console.log('error', error);
 | 
						console.log('error', error);
 | 
				
			||||||
@@ -1324,6 +1330,7 @@ function setStatusMessage(message, color) {
 | 
				
			|||||||
	document.getElementsByTagName('tf-navigation')[0].status = {
 | 
						document.getElementsByTagName('tf-navigation')[0].status = {
 | 
				
			||||||
		message: message,
 | 
							message: message,
 | 
				
			||||||
		color: color,
 | 
							color: color,
 | 
				
			||||||
 | 
							is_error: color == kErrorColor,
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user