From 96efaed07af646e44b6198cb846383a6639e4dda Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sun, 4 Aug 2019 14:03:04 +0300 Subject: [PATCH] Open list channel on data updates --- client/js/socket-events/msg_special.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/js/socket-events/msg_special.js b/client/js/socket-events/msg_special.js index d602e9b2..2e05c095 100644 --- a/client/js/socket-events/msg_special.js +++ b/client/js/socket-events/msg_special.js @@ -1,8 +1,13 @@ "use strict"; +const $ = require("jquery"); const socket = require("../socket"); -const {findChannel} = require("../vue"); +const {vueApp, findChannel} = require("../vue"); socket.on("msg:special", function(data) { findChannel(data.chan).channel.data = data.data; + + vueApp.$nextTick(() => { + $(`#sidebar .chan[data-id="${data.chan}"]`).trigger("click"); + }); });