6d6b5cb2a9
Fixes #2011
21 lines
485 B
JavaScript
21 lines
485 B
JavaScript
"use strict";
|
|
|
|
const $ = require("jquery");
|
|
const socket = require("../socket");
|
|
const sidebar = $("#sidebar");
|
|
|
|
socket.on("part", function(data) {
|
|
const chanMenuItem = sidebar.find(".chan[data-id='" + data.chan + "']");
|
|
|
|
// When parting from the active channel/query, jump to the network's lobby
|
|
if (chanMenuItem.hasClass("active")) {
|
|
chanMenuItem
|
|
.parent(".network")
|
|
.find(".lobby")
|
|
.trigger("click");
|
|
}
|
|
|
|
chanMenuItem.remove();
|
|
$("#chan-" + data.chan).remove();
|
|
});
|