Skip to content

Commit

Permalink
fix: fix message info view for when receipts are null
Browse files Browse the repository at this point in the history
  • Loading branch information
seavan committed Dec 11, 2018
1 parent dec4576 commit d9200f9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app/components/messaging/message-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ export default class MessageInfo extends SafeComponent {

get sections() {
const sections = [];
if (this.seenBy && this.seenBy.length)
sections.push({ data: this.seenBy, key: this.number() });
if (this.seenBy.length) sections.push({ data: this.seenBy, key: this.number() });
if (this.notSeenBy && this.notSeenBy.length)
sections.push({ data: this.notSeenBy, key: tx('title_sentTo') });

Expand All @@ -66,13 +65,13 @@ export default class MessageInfo extends SafeComponent {

@computed
get notSeenBy() {
return chatState.currentChat.otherParticipants.filter(this.notSeen) || [];
return chatState.currentChat.otherParticipants.filter(this.notSeen);
}

notSeen = item => !chatState.currentMessage.receipts.some(x => x.username === item.username);
notSeen = item => !this.seenBy.some(x => x.username === item.username);

number = () => {
const receipts = chatState.currentMessage.receipts.length;
const receipts = this.seenBy.length;
const participants = chatState.currentChat.otherParticipants.length;
if (receipts === participants) return `${tx('title_seenByAll')} (${receipts}/${receipts})`;
return `${tx('title_seenBy')} (${receipts}/${participants})`;
Expand Down

0 comments on commit d9200f9

Please sign in to comment.