From cb075137b3a84e4f881f2b6025785ad38568a313 Mon Sep 17 00:00:00 2001 From: germanocaumo Date: Tue, 26 Sep 2023 15:18:40 -0300 Subject: [PATCH] fix(emoji-rain): increase date comparison trigger The date comparison check was too strict/wrong, increase it to show the emojis created in the last second to account for delays in connection. --- .../imports/ui/components/emoji-rain/component.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bigbluebutton-html5/imports/ui/components/emoji-rain/component.jsx b/bigbluebutton-html5/imports/ui/components/emoji-rain/component.jsx index 180e37e921..0860915141 100644 --- a/bigbluebutton-html5/imports/ui/components/emoji-rain/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/emoji-rain/component.jsx @@ -87,7 +87,10 @@ const EmojiRain = ({ reactions }) => { useEffect(() => { if (isAnimating) { reactions.forEach((reaction) => { - if (Date() == reaction.creationDate && (reaction.reaction !== 'none')) { + //if (Date() == reaction.creationDate && (reaction.reaction !== 'none')) { + const currentTime = new Date().getTime(); + const secondsSinceCreated = (currentTime - reaction.creationDate.getTime()) / 1000; + if (secondsSinceCreated <= 1 && (reaction.reaction !== 'none')) { createEmojiRain(reaction.reaction); } });