From 40bfdf50cfb5eeef2cd51145766b946abb44cab2 Mon Sep 17 00:00:00 2001 From: Sophia Date: Mon, 12 Dec 2022 23:51:08 +0900 Subject: [PATCH] fix(core): fix bug that app calling notifiers without any logs --- src/app.ts | 4 ++++ src/notifiers/discord.ts | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app.ts b/src/app.ts index 4250dde..57e9279 100644 --- a/src/app.ts +++ b/src/app.ts @@ -238,6 +238,10 @@ export class App extends Loggable { return; } + if (newLogs.length <= 0) { + return; + } + const watcherMap = this.config.watcherMap; for (const [, notifier] of notifiers) { await notifier.notify( diff --git a/src/notifiers/discord.ts b/src/notifiers/discord.ts index 109eb29..af9d932 100644 --- a/src/notifiers/discord.ts +++ b/src/notifiers/discord.ts @@ -45,10 +45,6 @@ export class DiscordNotifier extends BaseNotifier<"Discord"> { throw new Error("DiscordNotifier is not initialized"); } - if (pairs.length <= 0) { - return; - } - const data: DiscordWebhookData = { content: null, embeds: [