From 8d93581dfccc24560cf575dd16710e2e4241a724 Mon Sep 17 00:00:00 2001 From: orangecoding Date: Mon, 5 Jul 2021 12:01:14 +0200 Subject: [PATCH] do not send notifications when listings have been filtered --- lib/FredyRuntime.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/FredyRuntime.js b/lib/FredyRuntime.js index 0513d36..412ac64 100755 --- a/lib/FredyRuntime.js +++ b/lib/FredyRuntime.js @@ -106,6 +106,9 @@ class FredyRuntime { } _notify(newListings) { + if (newListings.length === 0) { + throw new NoNewListingsWarning(); + } const sendNotifications = notify.send(this._providerId, newListings, this._notificationConfig, this._jobKey); return Promise.all(sendNotifications).then(() => newListings); }