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");
|
2019-11-02 19:40:59 +00:00
|
|
|
const store = require("../store").default;
|
2017-05-18 20:08:54 +00:00
|
|
|
|
|
|
|
socket.on("quit", function(data) {
|
2019-11-02 19:40:59 +00:00
|
|
|
store.commit("removeNetwork", data.network);
|
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
|
|
|
});
|