mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-14 19:25:26 -05:00
components/buffer-list: show buffers with errors in red
This commit is contained in:
parent
096fcbf829
commit
a603b79e33
2 changed files with 13 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
import * as irc from "../lib/irc.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 handleClick(event) {
|
||||
|
@ -26,6 +26,15 @@ function BufferItem(props) {
|
|||
if (props.buffer.unread != Unread.NONE) {
|
||||
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`
|
||||
<li class="${classes.join(" ")}">
|
||||
|
|
|
@ -158,6 +158,9 @@ button.danger:hover {
|
|||
color: white;
|
||||
background-color: var(--gray);
|
||||
}
|
||||
#buffer-list li.error a {
|
||||
color: red;
|
||||
}
|
||||
#buffer-list li.unread-message a {
|
||||
color: #b37400;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue