Fix: user reaction not showing right emoji

This commit is contained in:
Tainan Felipe 2024-04-26 16:52:28 -03:00
parent be96230894
commit da60b246d0

View File

@ -4,6 +4,9 @@ import RedisPubSub from '/imports/startup/server/redis';
import Logger from '/imports/startup/server/logger'; import Logger from '/imports/startup/server/logger';
import { extractCredentials } from '/imports/api/common/server/helpers'; import { extractCredentials } from '/imports/api/common/server/helpers';
const ALLOWED_REACTIONS = Meteor.settings.public.userReaction.reactions;
const nativeEmojis = ALLOWED_REACTIONS.map((reaction) => reaction.native);
export default function setUserReaction(reactionEmoji, userId = undefined) { export default function setUserReaction(reactionEmoji, userId = undefined) {
try { try {
const REDIS_CONFIG = Meteor.settings.private.redis; const REDIS_CONFIG = Meteor.settings.private.redis;
@ -15,6 +18,7 @@ export default function setUserReaction(reactionEmoji, userId = undefined) {
check(meetingId, String); check(meetingId, String);
check(requesterUserId, String); check(requesterUserId, String);
check(reactionEmoji, String); check(reactionEmoji, String);
if (!nativeEmojis.includes(reactionEmoji) && reactionEmoji !== 'none') return;
const payload = { const payload = {
reactionEmoji, reactionEmoji,