bug: Fixes Incorrect badge for Twilio SMS inbox and adds the ability to differentiate Twitter tweets and chats (#3003)
* bug: Fixes Incorrect badge in the thumbnail for Twilio SMS inbox * Minor fixes * Minor fixes * Review fixes * Minor fixes * fixes codeclimate error * Minor fixes * Minor fixes * Minor fixes * Review fixes * Minor fixes Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -36,12 +36,34 @@ export default {
|
||||
return this.channelType === INBOX_TYPES.EMAIL;
|
||||
},
|
||||
isATwilioSMSChannel() {
|
||||
const { phone_number: phoneNumber = '' } = this.inbox;
|
||||
return this.isATwilioChannel && !phoneNumber.startsWith('whatsapp');
|
||||
const { medium: medium = '' } = this.inbox;
|
||||
return this.isATwilioChannel && medium === 'sms';
|
||||
},
|
||||
isATwilioWhatsappChannel() {
|
||||
const { phone_number: phoneNumber = '' } = this.inbox;
|
||||
return this.isATwilioChannel && phoneNumber.startsWith('whatsapp');
|
||||
const { medium: medium = '' } = this.inbox;
|
||||
return this.isATwilioChannel && medium === 'whatsapp';
|
||||
},
|
||||
isTwitterInboxTweet() {
|
||||
return (
|
||||
this.chat &&
|
||||
this.chat.additional_attributes &&
|
||||
this.chat.additional_attributes.type === 'tweet'
|
||||
);
|
||||
},
|
||||
twilioBadge() {
|
||||
return `${this.isATwilioSMSChannel ? 'sms' : 'whatsapp'}`;
|
||||
},
|
||||
twitterBadge() {
|
||||
return `${this.isTwitterInboxTweet ? 'twitter-tweet' : 'twitter-chat'}`;
|
||||
},
|
||||
inboxBadge() {
|
||||
if (this.isATwitterInbox) {
|
||||
return this.twitterBadge;
|
||||
}
|
||||
if (this.isATwilioChannel) {
|
||||
return this.twilioBadge;
|
||||
}
|
||||
return this.channelType;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user