mirror of
https://github.com/discourse/discourse.git
synced 2026-08-19 01:14:56 -05:00
FIX: ensures removing a reaction doesn’t remove others (#20869)
This commit is contained in:
@@ -151,18 +151,23 @@ export default class ChatMessage {
|
||||
}
|
||||
existingReaction.users.pushObject(actor);
|
||||
} else {
|
||||
existingReaction.count = existingReaction.count - 1;
|
||||
const existingUserReaction = existingReaction.users.find(
|
||||
(user) => user.id === actor.id
|
||||
);
|
||||
|
||||
if (!existingUserReaction) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (selfReaction) {
|
||||
existingReaction.reacted = false;
|
||||
}
|
||||
|
||||
if (existingReaction.count === 0) {
|
||||
if (existingReaction.count === 1) {
|
||||
this.reactions.removeObject(existingReaction);
|
||||
} else {
|
||||
existingReaction.users.removeObject(
|
||||
existingReaction.users.find((user) => user.id === actor.id)
|
||||
);
|
||||
existingReaction.count = existingReaction.count - 1;
|
||||
existingReaction.users.removeObject(existingUserReaction);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user