Merge pull request #2480 from thelounge/xpaw/fix-2478

Show connect window when last network is removed
This commit is contained in:
Jérémie Astori 2018-05-29 23:36:22 -04:00 committed by GitHub
commit 24b9b93c3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -202,7 +202,7 @@ function renderNetworks(data, singleNetwork) {
sidebar.find(".networks").append( sidebar.find(".networks").append(
templates.network({ templates.network({
networks: data.networks, networks: data.networks,
}) }).trim()
); );
collapsed.forEach((key) => { collapsed.forEach((key) => {

View File

@ -16,11 +16,16 @@ socket.on("quit", function(data) {
network.remove(); network.remove();
const chan = sidebar.find(".chan") const chan = sidebar.find(".chan");
.eq(0)
.trigger("click");
if (chan.length === 0) { if (chan.length === 0) {
sidebar.find(".empty").show(); sidebar.find(".empty").show();
// Open the connect window
$("#footer .connect").trigger("click", {
pushState: false,
});
} else {
chan.eq(0).trigger("click");
} }
}); });