Fix unread indicator not showing up

This commit is contained in:
Simon Ser 2020-06-24 17:46:43 +02:00
parent 9223953e3a
commit 80fee31f2c
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -114,16 +114,16 @@ export default class App extends Component {
msg.tags["time"] = `${YYYY}-${MM}-${DD}T${hh}:${mm}:${ss}.${sss}Z`; msg.tags["time"] = `${YYYY}-${MM}-${DD}T${hh}:${mm}:${ss}.${sss}Z`;
} }
var unread = Unread.NONE; var msgUnread = Unread.NONE;
if (msg.command == "PRIVMSG" || msg.command == "NOTICE") { if (msg.command == "PRIVMSG" || msg.command == "NOTICE") {
unread = Unread.MESSAGE; msgUnread = Unread.MESSAGE;
} }
this.createBuffer(bufName); this.createBuffer(bufName);
this.setBufferState(bufName, (buf, state) => { this.setBufferState(bufName, (buf, state) => {
var unread = buf.unread; var unread = buf.unread;
if (state.activeBuffer != buf.name) { if (state.activeBuffer != buf.name) {
unread = Unread.union(buf.unread, unread); unread = Unread.union(unread, msgUnread);
} }
return { return {
messages: buf.messages.concat(msg), messages: buf.messages.concat(msg),