summaryrefslogtreecommitdiff
path: root/commands.js
diff options
context:
space:
mode:
Diffstat (limited to 'commands.js')
-rw-r--r--commands.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/commands.js b/commands.js
index 59be364..138c55f 100644
--- a/commands.js
+++ b/commands.js
@@ -67,10 +67,11 @@ module.exports.joinChannel = function (channel, sendJoin) {
}
module.exports.removeChannel = function(channel, sendPart) {
- var channelObj = client.channel(channel)
+
chanId = $("[data-tab='"+channel+"'].chat").attr("data-id");
$("[data-tab='"+channel+"']").remove();
if (sendPart) {
+ var channelObj = client.channel(channel)
channelObj.part();
}
while ($("[data-id="+(chanId-1)+"]").length == 0 && chanId >=0) {