pl-fe: fix announcement reactions optimistic response
Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@ -15,7 +15,7 @@ const updateReactions = (reactions: AnnouncementReaction[], name: string, count:
|
|||||||
const idx = reactions.findIndex(reaction => reaction.name === name);
|
const idx = reactions.findIndex(reaction => reaction.name === name);
|
||||||
|
|
||||||
if (idx > -1) {
|
if (idx > -1) {
|
||||||
reactions = reactions.map(reaction => reaction.name === name ? updateReaction(reaction, count, me, overwrite) : reaction);
|
return reactions.map(reaction => reaction.name === name ? updateReaction(reaction, count, me, overwrite) : reaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [...reactions, updateReaction(v.parse(announcementReactionSchema, { name }), count, me, overwrite)];
|
return [...reactions, updateReaction(v.parse(announcementReactionSchema, { name }), count, me, overwrite)];
|
||||||
|
|||||||
Reference in New Issue
Block a user