mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 12:03:11 +00:00
Only send /join for current channel if there are no arguments
This commit is contained in:
parent
7ba14fe4e3
commit
5f0f745d10
1 changed files with 9 additions and 5 deletions
|
@ -3,18 +3,22 @@
|
|||
const $ = require("jquery");
|
||||
|
||||
exports.input = function(args) {
|
||||
const channel = args[0];
|
||||
const utils = require("../utils");
|
||||
const socket = require("../socket");
|
||||
const {vueApp} = require("../vue");
|
||||
|
||||
if (channel) {
|
||||
const chan = utils.findCurrentNetworkChan(channel);
|
||||
if (args.length > 0) {
|
||||
const channel = args[0];
|
||||
|
||||
if (chan) {
|
||||
$(`#sidebar .chan[data-id="${chan.id}"]`).trigger("click");
|
||||
if (channel.length > 0) {
|
||||
const chan = utils.findCurrentNetworkChan(channel);
|
||||
|
||||
if (chan) {
|
||||
$(`#sidebar .chan[data-id="${chan.id}"]`).trigger("click");
|
||||
}
|
||||
}
|
||||
} else if (vueApp.activeChannel.channel.type === "channel") {
|
||||
// If `/join` command is used without any arguments, re-join current channel
|
||||
socket.emit("input", {
|
||||
target: vueApp.activeChannel.channel.id,
|
||||
text: `/join ${vueApp.activeChannel.channel.name}`,
|
||||
|
|
Loading…
Reference in a new issue