thelounge/client/js/socket-events/nick.js

17 lines
372 B
JavaScript
Raw Normal View History

2017-05-18 20:08:54 +00:00
"use strict";
const $ = require("jquery");
const socket = require("../socket");
const utils = require("../utils");
const sidebar = $("#sidebar");
socket.on("nick", function(data) {
const id = data.network;
const nick = data.nick;
const network = sidebar.find("#network-" + id).data("nick", nick);
2017-05-18 20:08:54 +00:00
if (network.find(".active").length) {
utils.setNick(nick);
}
});