mirror of
https://github.com/thelounge/thelounge
synced 2024-11-14 08:17:16 +00:00
Remove unused var, satisfy linter rules, simplify calls
This commit is contained in:
parent
3890aaad6b
commit
3244ec91e8
2 changed files with 11 additions and 19 deletions
|
@ -188,17 +188,8 @@ $(function() {
|
|||
const args = text.substr(1).split(" ");
|
||||
const cmd = args.shift().toLowerCase();
|
||||
if (typeof utils.inputCommands[cmd] === "function") {
|
||||
if (cmd === "join") {
|
||||
const channel = args.shift();
|
||||
if (channel !== "") {
|
||||
if (utils.inputCommands[cmd](channel)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (utils.inputCommands[cmd]()) {
|
||||
return;
|
||||
}
|
||||
if (utils.inputCommands[cmd](args)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
const $ = require("jquery");
|
||||
const chat = $("#chat");
|
||||
const input = $("#input");
|
||||
|
||||
var serverHash = -1;
|
||||
var lastMessageId = -1;
|
||||
|
||||
module.exports = {
|
||||
inputCommands: { collapse, expand, join },
|
||||
inputCommands: {collapse, expand, join},
|
||||
findCurrentNetworkChan,
|
||||
serverHash,
|
||||
lastMessageId,
|
||||
|
@ -54,12 +53,14 @@ function expand() {
|
|||
return true;
|
||||
}
|
||||
|
||||
function join(channel) {
|
||||
var chan = findCurrentNetworkChan(channel);
|
||||
|
||||
if (chan.length) {
|
||||
chan.click();
|
||||
return true;
|
||||
function join(args) {
|
||||
const channel = args[0];
|
||||
if (channel) {
|
||||
const chan = findCurrentNetworkChan(channel);
|
||||
if (chan.length) {
|
||||
chan.click();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue