From a3e6e4f31992db5ac31c8c8fb67163c672e19bf2 Mon Sep 17 00:00:00 2001 From: almeidx Date: Thu, 29 Jul 2021 01:51:11 +0100 Subject: [PATCH] removed unnecessary conditional --- backend/src/index.ts | 2 +- .../src/plugins/Utility/events/AutoJoinThreadEvt.ts | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index 70bf4d2e..7ab1032d 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -174,7 +174,7 @@ connect().then(async () => { client.setMaxListeners(200); client.on("rateLimit", rateLimitData => { - logger.info(`[429] ${rateLimitData}`); + logger.info(`[429] ${JSON.stringify(rateLimitData)}`); }); client.on("error", err => { diff --git a/backend/src/plugins/Utility/events/AutoJoinThreadEvt.ts b/backend/src/plugins/Utility/events/AutoJoinThreadEvt.ts index 6789073c..84c36768 100644 --- a/backend/src/plugins/Utility/events/AutoJoinThreadEvt.ts +++ b/backend/src/plugins/Utility/events/AutoJoinThreadEvt.ts @@ -5,7 +5,7 @@ export const AutoJoinThreadEvt = utilityEvt({ async listener(meta) { const config = meta.pluginData.config.get(); - if (config.autojoin_threads && meta.args.thread.joinable && !meta.args.thread.joined) { + if (config.autojoin_threads && meta.args.thread.joinable) { await meta.args.thread.join(); } }, @@ -16,11 +16,10 @@ export const AutoJoinThreadSyncEvt = utilityEvt({ async listener(meta) { const config = meta.pluginData.config.get(); - if (config.autojoin_threads) { - for (const thread of meta.args.threads.values()) { - if (!thread.joined && thread.joinable) { - await thread.join(); - } + if (config.autojoin_threads) return; + for (const thread of meta.args.threads.values()) { + if (!thread.joined && thread.joinable) { + await thread.join(); } } },