From b1771455af7ac0e3cfd1018865cc2bb44e048730 Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Fri, 11 Dec 2020 06:53:30 +0100 Subject: fix(notifier): notifyModeratorsOfNewAbuse closes #3445 --- server/lib/notifier.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/lib/notifier.ts b/server/lib/notifier.ts index 1da81a535..6af7316f0 100644 --- a/server/lib/notifier.ts +++ b/server/lib/notifier.ts @@ -482,15 +482,16 @@ class Notifier { return { users: moderators, settingGetter, notificationCreator, emailSender: emailSenderModerators } } - const [ reporterOptions, moderatorsOptions ] = await Promise.all([ + const options = await Promise.all([ buildReporterOptions(), buildModeratorsOptions() ]) - return Promise.all([ - this.notify(reporterOptions), - this.notify(moderatorsOptions) - ]) + return Promise.all( + options + .filter(opt => opt) + .map(this.notify) + ) } private async notifyModeratorsOfVideoAutoBlacklist (videoBlacklist: MVideoBlacklistLightVideo) { -- cgit v1.2.3