2017-05-18 20:08:54 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const $ = require("jquery");
|
|
|
|
const socket = require("../socket");
|
|
|
|
const sidebar = $("#sidebar");
|
2018-07-08 13:42:54 +00:00
|
|
|
const {vueApp} = require("../vue");
|
2017-05-18 20:08:54 +00:00
|
|
|
|
|
|
|
socket.on("quit", function(data) {
|
2019-11-09 08:55:50 +00:00
|
|
|
vueApp.networks.splice(
|
|
|
|
vueApp.networks.findIndex((n) => n.uuid === data.network),
|
|
|
|
1
|
|
|
|
);
|
2018-07-06 18:15:15 +00:00
|
|
|
|
2018-07-08 13:42:54 +00:00
|
|
|
vueApp.$nextTick(() => {
|
2018-07-06 18:15:15 +00:00
|
|
|
const chan = sidebar.find(".chan");
|
2017-09-12 12:52:16 +00:00
|
|
|
|
2018-07-06 18:15:15 +00:00
|
|
|
if (chan.length === 0) {
|
|
|
|
// Open the connect window
|
|
|
|
$("#footer .connect").trigger("click", {
|
|
|
|
pushState: false,
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
chan.eq(0).trigger("click");
|
|
|
|
}
|
|
|
|
});
|
2017-05-18 20:08:54 +00:00
|
|
|
});
|