diff --git a/client/js/render.js b/client/js/render.js index 9836faf7..44c512b5 100644 --- a/client/js/render.js +++ b/client/js/render.js @@ -202,7 +202,7 @@ function renderNetworks(data, singleNetwork) { sidebar.find(".networks").append( templates.network({ networks: data.networks, - }) + }).trim() ); collapsed.forEach((key) => { diff --git a/client/js/socket-events/quit.js b/client/js/socket-events/quit.js index 18365448..1b2bba8b 100644 --- a/client/js/socket-events/quit.js +++ b/client/js/socket-events/quit.js @@ -16,11 +16,16 @@ socket.on("quit", function(data) { network.remove(); - const chan = sidebar.find(".chan") - .eq(0) - .trigger("click"); + const chan = sidebar.find(".chan"); if (chan.length === 0) { sidebar.find(".empty").show(); + + // Open the connect window + $("#footer .connect").trigger("click", { + pushState: false, + }); + } else { + chan.eq(0).trigger("click"); } });