Skip to content

Commit

Permalink
fix: issue with success showing duplicate usernames if original sende…
Browse files Browse the repository at this point in the history
…r includes themself in list of receipients
  • Loading branch information
akinsey committed May 22, 2020
1 parent 112a8d9 commit f4be091
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/ept-messages/client/messages.controller.js
Expand Up @@ -240,7 +240,8 @@ var ctrl = [
message.sender_username = ctrl.newMessage.sender_username;
message.sender_avatar = Session.user.avatar;
ctrl.currentConversation.messages.unshift(message);
Alert.success('Reply sent to ' + message.receiver_usernames.join(', '));
var receiverNames = message.receiver_usernames.filter((it, i, ar) => ar.indexOf(it) === i).sort();
Alert.success('Reply sent to ' + receiverNames.join(', '));
})
.then(ctrl.loadRecentMessages)
.then(function() {
Expand Down

0 comments on commit f4be091

Please sign in to comment.