From 3300276c2722442043d0c58113b601f222b9bb4e Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sun, 8 Jul 2018 20:35:46 +0300 Subject: [PATCH] Delete some files and undo server change --- client/js/libs/handlebars/slugify.js | 7 ------- client/js/libs/handlebars/tojson.js | 5 ----- client/js/socket-events/part.js | 9 ++++++--- src/plugins/inputs/part.js | 1 - src/plugins/irc-events/part.js | 1 - 5 files changed, 6 insertions(+), 17 deletions(-) delete mode 100644 client/js/libs/handlebars/slugify.js delete mode 100644 client/js/libs/handlebars/tojson.js diff --git a/client/js/libs/handlebars/slugify.js b/client/js/libs/handlebars/slugify.js deleted file mode 100644 index e30b8dd5..00000000 --- a/client/js/libs/handlebars/slugify.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -const escape = require("css.escape"); - -module.exports = function(orig) { - return escape(orig.toLowerCase()); -}; diff --git a/client/js/libs/handlebars/tojson.js b/client/js/libs/handlebars/tojson.js deleted file mode 100644 index 0078fbff..00000000 --- a/client/js/libs/handlebars/tojson.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; - -module.exports = function tojson(context) { - return JSON.stringify(context); -}; diff --git a/client/js/socket-events/part.js b/client/js/socket-events/part.js index 0c2bc327..9dcf555c 100644 --- a/client/js/socket-events/part.js +++ b/client/js/socket-events/part.js @@ -2,7 +2,7 @@ const $ = require("jquery"); const socket = require("../socket"); -const {vueApp} = require("../vue"); +const {vueApp, findChannel} = require("../vue"); socket.on("part", function(data) { // When parting from the active channel/query, jump to the network's lobby @@ -13,6 +13,9 @@ socket.on("part", function(data) { .trigger("click"); } - const network = vueApp.networks.find((n) => n.uuid === data.network); - network.channels.splice(network.channels.findIndex((c) => c.id === data.chan), 1); + const channel = findChannel(data.chan); + + if (channel) { + channel.network.channels.splice(channel.network.channels.findIndex((c) => c.id === data.chan), 1); + } }); diff --git a/src/plugins/inputs/part.js b/src/plugins/inputs/part.js index 2dbb7a87..9fda89aa 100644 --- a/src/plugins/inputs/part.js +++ b/src/plugins/inputs/part.js @@ -35,7 +35,6 @@ exports.input = function(network, chan, cmd, args) { network.channels = _.without(network.channels, target); target.destroy(); this.emit("part", { - network: network.uuid, chan: target.id, }); this.save(); diff --git a/src/plugins/irc-events/part.js b/src/plugins/irc-events/part.js index a32a6c3e..851f3b1e 100644 --- a/src/plugins/irc-events/part.js +++ b/src/plugins/irc-events/part.js @@ -29,7 +29,6 @@ module.exports = function(irc, network) { chan.destroy(); client.save(); client.emit("part", { - network: network.uuid, chan: chan.id, }); } else {