mirror of
https://github.com/thelounge/thelounge
synced 2024-11-29 15:30:22 +00:00
26 lines
530 B
JavaScript
26 lines
530 B
JavaScript
"use strict";
|
|
|
|
const $ = require("jquery");
|
|
const socket = require("../socket");
|
|
const sidebar = $("#sidebar");
|
|
const {vueApp} = require("../vue");
|
|
|
|
socket.on("quit", function(data) {
|
|
vueApp.networks.splice(
|
|
vueApp.networks.findIndex((n) => n.uuid === data.network),
|
|
1
|
|
);
|
|
|
|
vueApp.$nextTick(() => {
|
|
const chan = sidebar.find(".chan");
|
|
|
|
if (chan.length === 0) {
|
|
// Open the connect window
|
|
$("#footer .connect").trigger("click", {
|
|
pushState: false,
|
|
});
|
|
} else {
|
|
chan.eq(0).trigger("click");
|
|
}
|
|
});
|
|
});
|