diff --git a/client/js/socket-events/msg.js b/client/js/socket-events/msg.js index 855ef2ad..4a5b9cd2 100644 --- a/client/js/socket-events/msg.js +++ b/client/js/socket-events/msg.js @@ -24,7 +24,7 @@ socket.on("msg", function(data) { } let channel = receivingChannel.channel; - const isActiveChannel = + let isActiveChannel = store.state.activeChannel && store.state.activeChannel.channel === channel; // Display received notices and errors in currently active channel. @@ -37,6 +37,10 @@ socket.on("msg", function(data) { ) { channel = store.state.activeChannel.channel; + // Do not update unread/highlight counters for this channel + // as we are putting this message in the active channel + isActiveChannel = true; + if (data.chan === channel.id) { // If active channel is the intended channel for this message, // remove the showInActive flag