shouldUpdateReaction method
Implementation
bool shouldUpdateReaction(
List<Reaction> reactions,
String identity,
String newEmoji,
) {
if (identity == "" || newEmoji == "") return true;
final existing = reactions.firstWhere(
(r) => r.reactor == identity,
orElse: () => Reaction(),
);
if (existing.reactor == null) {
// User hasn't reacted yet → adding
return true;
}
if (existing.emoji == newEmoji) {
// Same emoji → removing
return false;
}
// Different emoji → updating
return true;
}