From 94901f16627b6fb53c2078dc84fa919d9f138302 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 8 Nov 2021 15:03:05 +0100 Subject: [PATCH] Request WHO info w/ empty message list in switchBuffer --- components/app.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/components/app.js b/components/app.js index 661ba94..706ca28 100644 --- a/components/app.js +++ b/components/app.js @@ -350,18 +350,17 @@ export default class App extends Component { this.buffer.current.focus(); } - if (buf.messages.length == 0) { - return; - } - let lastMsg = buf.messages[buf.messages.length - 1]; - this.setReceipt(buf.name, ReceiptType.READ, lastMsg); + if (buf.messages.length > 0) { + let lastMsg = buf.messages[buf.messages.length - 1]; + this.setReceipt(buf.name, ReceiptType.READ, lastMsg); - let client = this.clients.get(buf.server); - this.bufferStore.put({ - name: buf.name, - server: client.params, - unread: Unread.NONE, - }); + let client = this.clients.get(buf.server); + this.bufferStore.put({ + name: buf.name, + server: client.params, + unread: Unread.NONE, + }); + } let server = this.state.servers.get(buf.server); if (buf.type === BufferType.NICK && !server.users.has(buf.name)) {