feat: use better counts

This commit is contained in:
Shivam Mishra
2025-03-18 14:37:58 +05:30
parent ebd5b84233
commit 2bd20f229d
2 changed files with 14 additions and 7 deletions
@@ -238,13 +238,17 @@ export default {
return this.currentChat.unread_count || 0;
},
unreadMessageLabel() {
const count =
this.unreadMessageCount > 9 ? '9+' : this.unreadMessageCount;
const label =
this.unreadMessageCount > 1
? this.$t('CONVERSATION.UNREAD_MESSAGES')
: this.$t('CONVERSATION.UNREAD_MESSAGE');
return `${count} ${label}`;
if (this.unreadMessageCount <= 1) {
return this.$t('CONVERSATION.SINGLE_UNREAD_MESSAGE');
}
if (this.unreadMessageCount > 9) {
return this.$t('CONVERSATION.UNREAD_COUNT_OVERFLOW');
}
return this.$t('CONVERSATION.UNREAD_COUNT', {
count: this.unreadMessageCount,
});
},
isInstagramDM() {
return this.conversationType === 'instagram_direct_message';