feat: Create a new conversation from the contact panel (#2019)

* Chore: Improve button component styles
This commit is contained in:
Nithin David Thomas
2021-04-16 20:31:07 +05:30
committed by GitHub
parent c287ad08fb
commit 864471a21e
16 changed files with 469 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
import * as MutationHelpers from 'shared/helpers/vuex/mutationHelpers';
import * as types from '../mutation-types';
import { INBOX_TYPES } from 'shared/mixins/inboxMixin';
import InboxesAPI from '../../api/inboxes';
import WebChannel from '../../api/channel/webChannel';
import FBChannel from '../../api/channel/fbChannel';
@@ -41,6 +42,20 @@ export const getters = {
getInboxes($state) {
return $state.records;
},
getNewConversationInboxes($state) {
return $state.records.filter(inbox => {
const {
channel_type: channelType,
phone_number: phoneNumber = '',
} = inbox;
const isEmailChannel = channelType === INBOX_TYPES.EMAIL;
const isSmsChannel =
channelType === INBOX_TYPES.TWILIO &&
phoneNumber.startsWith('whatsapp');
return isEmailChannel || isSmsChannel;
});
},
getInbox: $state => inboxId => {
const [inbox] = $state.records.filter(
record => record.id === Number(inboxId)