mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
dict: Remove setdefault method.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
8872aca907
commit
b16222a38b
@@ -410,10 +410,11 @@ exports.get_message_reactions = function (message) {
|
||||
return;
|
||||
}
|
||||
reaction.user_ids = [];
|
||||
const collapsed_reaction = message_reactions.setdefault(
|
||||
reaction.local_id,
|
||||
_.omit(reaction, 'user')
|
||||
);
|
||||
let collapsed_reaction = message_reactions.get(reaction.local_id);
|
||||
if (collapsed_reaction === undefined) {
|
||||
collapsed_reaction = _.omit(reaction, 'user');
|
||||
message_reactions.set(reaction.local_id, collapsed_reaction);
|
||||
}
|
||||
collapsed_reaction.user_ids.push(user_id);
|
||||
});
|
||||
const reactions = message_reactions.items().map(function (item) {
|
||||
|
||||
Reference in New Issue
Block a user