From 283aa5513c197f2edb4cf501835a6010e8751fc6 Mon Sep 17 00:00:00 2001 From: Midgard Date: Wed, 8 Jun 2022 21:12:45 +0200 Subject: [PATCH] Also check endpoint in channel equality checks --- js/controller.js | 2 +- js/view/sidebar.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/js/controller.js b/js/controller.js index c8eec1d..bc1df19 100644 --- a/js/controller.js +++ b/js/controller.js @@ -119,7 +119,7 @@ function channelNameElements(team, channel) { function switchToChannel(client, team, channel) { for (let el of byId("channel_list").childNodes) { - if (el.dataset["id"] == channel.id) { + if (el.dataset["endpoint"] == client.endpoint && el.dataset["id"] == channel.id) { el.className = "active"; } else { el.className = ""; diff --git a/js/view/sidebar.js b/js/view/sidebar.js index 3c028ec..e9ebd98 100644 --- a/js/view/sidebar.js +++ b/js/view/sidebar.js @@ -39,6 +39,7 @@ function populateChannelList() { li.appendChild(a); li.dataset["id"] = channel.id; + li.dataset["endpoint"] = client.endpoint; nodes.push(li); } byId("channel_list").append(...nodes);