diff --git a/client/js/socket-events/init.js b/client/js/socket-events/init.js index 621984cd..f2cd9fc1 100644 --- a/client/js/socket-events/init.js +++ b/client/js/socket-events/init.js @@ -64,8 +64,7 @@ function openCorrectChannel(clientActive, serverActive) { // Open window provided in location.hash if (target.length === 0 && window.location.hash) { - target = $("#footer, #sidebar, #help") - .find(`[data-target="${escape(window.location.hash)}"]`); + target = $(`[data-target="${escape(window.location.hash)}"]`).first(); } // Open last active channel according to the server diff --git a/client/views/chat.tpl b/client/views/chat.tpl index b5b32d30..16d287bb 100644 --- a/client/views/chat.tpl +++ b/client/views/chat.tpl @@ -1,5 +1,11 @@ {{#each channels}} -
+
{{#equal type "channel"}}