Show connect window when last network is removed

This commit is contained in:
Pavel Djundik 2018-05-29 13:07:18 +03:00
parent 2de022235f
commit 000d56a96d
2 changed files with 9 additions and 4 deletions

View File

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

View File

@ -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");
}
});