hardlounge/client/js/socket-events/quit.js

25 lines
525 B
JavaScript
Raw Normal View History

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");
const store = require("../store").default;
2017-05-18 20:08:54 +00:00
socket.on("quit", function(data) {
store.commit("removeNetwork", data.network);
2018-07-08 13:42:54 +00:00
vueApp.$nextTick(() => {
const chan = sidebar.find(".chan");
2017-09-12 12:52:16 +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
});