2020-08-05 12:16:17 +00:00
|
|
|
export const INBOX_TYPES = {
|
|
|
|
WEB: 'Channel::WebWidget',
|
|
|
|
FB: 'Channel::FacebookPage',
|
|
|
|
TWITTER: 'Channel::TwitterProfile',
|
|
|
|
TWILIO: 'Channel::TwilioSms',
|
|
|
|
API: 'Channel::Api',
|
|
|
|
EMAIL: 'Channel::Email',
|
2021-09-15 12:42:56 +00:00
|
|
|
TELEGRAM: 'Channel::Telegram',
|
2021-09-14 17:14:53 +00:00
|
|
|
LINE: 'Channel::Line',
|
2020-08-05 12:16:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
computed: {
|
|
|
|
channelType() {
|
|
|
|
return this.inbox.channel_type;
|
|
|
|
},
|
|
|
|
isAPIInbox() {
|
|
|
|
return this.channelType === INBOX_TYPES.API;
|
|
|
|
},
|
|
|
|
isATwitterInbox() {
|
|
|
|
return this.channelType === INBOX_TYPES.TWITTER;
|
|
|
|
},
|
|
|
|
isAFacebookInbox() {
|
|
|
|
return this.channelType === INBOX_TYPES.FB;
|
|
|
|
},
|
|
|
|
isAWebWidgetInbox() {
|
|
|
|
return this.channelType === INBOX_TYPES.WEB;
|
|
|
|
},
|
|
|
|
isATwilioChannel() {
|
|
|
|
return this.channelType === INBOX_TYPES.TWILIO;
|
|
|
|
},
|
2021-09-14 17:14:53 +00:00
|
|
|
isALineChannel() {
|
|
|
|
return this.channelType === INBOX_TYPES.LINE;
|
|
|
|
},
|
2020-08-05 12:16:17 +00:00
|
|
|
isAnEmailChannel() {
|
|
|
|
return this.channelType === INBOX_TYPES.EMAIL;
|
|
|
|
},
|
|
|
|
isATwilioSMSChannel() {
|
|
|
|
const { phone_number: phoneNumber = '' } = this.inbox;
|
|
|
|
return this.isATwilioChannel && !phoneNumber.startsWith('whatsapp');
|
|
|
|
},
|
|
|
|
isATwilioWhatsappChannel() {
|
|
|
|
const { phone_number: phoneNumber = '' } = this.inbox;
|
|
|
|
return this.isATwilioChannel && phoneNumber.startsWith('whatsapp');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|