From 0069a5f2a3b346c4a1d4360d5b496f6200e57e20 Mon Sep 17 00:00:00 2001 From: Mentor Date: Mon, 22 Aug 2022 14:40:24 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20faulty=20recency=20selector?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/integrations/changingroom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/integrations/changingroom.js b/functions/integrations/changingroom.js index 7572b71..5424313 100644 --- a/functions/integrations/changingroom.js +++ b/functions/integrations/changingroom.js @@ -274,7 +274,7 @@ exports.notify_holders_of_changing_room_updates = async context => { console.log( `${ owner_meta.length } Owners in cache` ) const owners_emailed_recently = owner_meta // Too recently means last_emailed is larger than the point in the past past which it's been too long - .filter( ( { last_emailed_about_outfit } ) => !last_emailed_about_outfit || ( last_emailed_about_outfit > ( Date.now() - newOutfitAllowedInterval ) ) ) + .filter( ( { last_emailed_about_outfit } ) => last_emailed_about_outfit && ( last_emailed_about_outfit > ( Date.now() - newOutfitAllowedInterval ) ) ) .map( ( { uid } ) => uid.toLowerCase() ) // Remove owners from list of they were emailed too recently