Merge pull request #3347 from thelounge/xpaw/focus-on-special-upd

Open list channel on data updates
This commit is contained in:
Pavel Djundik 2019-08-07 15:16:24 +03:00 committed by GitHub
commit b4eb538903
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,8 +1,13 @@
"use strict"; "use strict";
const $ = require("jquery");
const socket = require("../socket"); const socket = require("../socket");
const {findChannel} = require("../vue"); const {vueApp, findChannel} = require("../vue");
socket.on("msg:special", function(data) { socket.on("msg:special", function(data) {
findChannel(data.chan).channel.data = data.data; findChannel(data.chan).channel.data = data.data;
vueApp.$nextTick(() => {
$(`#sidebar .chan[data-id="${data.chan}"]`).trigger("click");
});
}); });