Fix incorrectly updating unread counter for 'show in active' messages

This commit is contained in:
Pavel Djundik 2020-02-17 17:02:34 +02:00
parent 44de1dd03f
commit 9db1d0f7c8

View file

@ -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