Mark buffers as unread on new message
This commit is contained in:
parent
9ff1f164e0
commit
cbe76ab824
4 changed files with 64 additions and 23 deletions
|
@ -1,4 +1,5 @@
|
|||
import { html, Component } from "/lib/index.js";
|
||||
import { SERVER_BUFFER, Unread } from "/state.js";
|
||||
|
||||
function BufferItem(props) {
|
||||
function handleClick(event) {
|
||||
|
@ -7,12 +8,19 @@ function BufferItem(props) {
|
|||
}
|
||||
|
||||
var name = props.buffer.name;
|
||||
if (name == "*") {
|
||||
if (name == SERVER_BUFFER) {
|
||||
name = "server";
|
||||
}
|
||||
|
||||
var activeClass = props.active ? "active" : "";
|
||||
|
||||
var unreadClass = "";
|
||||
if (props.buffer.unread != Unread.NONE) {
|
||||
unreadClass = "unread-" + props.buffer.unread;
|
||||
}
|
||||
|
||||
return html`
|
||||
<li class=${props.active ? "active" : ""}>
|
||||
<li class="${activeClass} ${unreadClass}">
|
||||
<a href="#" onClick=${handleClick}>${name}</a>
|
||||
</li>
|
||||
`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue