forked from CringeStudios/gamja
components/buffer-list: show buffers with errors in red
This commit is contained in:
parent
096fcbf829
commit
a603b79e33
@ -1,6 +1,6 @@
|
|||||||
import * as irc from "../lib/irc.js";
|
import * as irc from "../lib/irc.js";
|
||||||
import { html, Component } from "../lib/index.js";
|
import { html, Component } from "../lib/index.js";
|
||||||
import { BufferType, Unread, getBufferURL, getServerName } from "../state.js";
|
import { BufferType, Unread, ServerStatus, getBufferURL, getServerName } from "../state.js";
|
||||||
|
|
||||||
function BufferItem(props) {
|
function BufferItem(props) {
|
||||||
function handleClick(event) {
|
function handleClick(event) {
|
||||||
@ -26,6 +26,15 @@ function BufferItem(props) {
|
|||||||
if (props.buffer.unread != Unread.NONE) {
|
if (props.buffer.unread != Unread.NONE) {
|
||||||
classes.push("unread-" + props.buffer.unread);
|
classes.push("unread-" + props.buffer.unread);
|
||||||
}
|
}
|
||||||
|
if (props.buffer.type === BufferType.SERVER) {
|
||||||
|
let isError = props.server.status === ServerStatus.DISCONNECTED;
|
||||||
|
if (props.bouncerNetwork && props.bouncerNetwork.error) {
|
||||||
|
isError = true;
|
||||||
|
}
|
||||||
|
if (isError) {
|
||||||
|
classes.push("error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<li class="${classes.join(" ")}">
|
<li class="${classes.join(" ")}">
|
||||||
|
@ -158,6 +158,9 @@ button.danger:hover {
|
|||||||
color: white;
|
color: white;
|
||||||
background-color: var(--gray);
|
background-color: var(--gray);
|
||||||
}
|
}
|
||||||
|
#buffer-list li.error a {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
#buffer-list li.unread-message a {
|
#buffer-list li.unread-message a {
|
||||||
color: #b37400;
|
color: #b37400;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user