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);