fix: Replace Whatsapp inbox icon (#1311)
This commit is contained in:
parent
3d379b071d
commit
df527088e9
2 changed files with 7 additions and 4 deletions
|
@ -258,6 +258,7 @@ export default {
|
||||||
label: inbox.name,
|
label: inbox.name,
|
||||||
toState: frontendURL(`accounts/${this.accountId}/inbox/${inbox.id}`),
|
toState: frontendURL(`accounts/${this.accountId}/inbox/${inbox.id}`),
|
||||||
type: inbox.channel_type,
|
type: inbox.channel_type,
|
||||||
|
phoneNumber: inbox.phone_number,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
@ -59,7 +59,7 @@ import router from '../../routes';
|
||||||
import adminMixin from '../../mixins/isAdmin';
|
import adminMixin from '../../mixins/isAdmin';
|
||||||
import { INBOX_TYPES } from 'shared/mixins/inboxMixin';
|
import { INBOX_TYPES } from 'shared/mixins/inboxMixin';
|
||||||
|
|
||||||
const getInboxClassByType = type => {
|
const getInboxClassByType = (type, phoneNumber) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case INBOX_TYPES.WEB:
|
case INBOX_TYPES.WEB:
|
||||||
return 'ion-earth';
|
return 'ion-earth';
|
||||||
|
@ -71,7 +71,9 @@ const getInboxClassByType = type => {
|
||||||
return 'ion-social-twitter';
|
return 'ion-social-twitter';
|
||||||
|
|
||||||
case INBOX_TYPES.TWILIO:
|
case INBOX_TYPES.TWILIO:
|
||||||
return 'ion-android-textsms';
|
return phoneNumber.startsWith('whatsapp')
|
||||||
|
? 'ion-social-whatsapp-outline'
|
||||||
|
: 'ion-android-textsms';
|
||||||
|
|
||||||
case INBOX_TYPES.API:
|
case INBOX_TYPES.API:
|
||||||
return 'ion-cloud';
|
return 'ion-cloud';
|
||||||
|
@ -119,8 +121,8 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
computedInboxClass(child) {
|
computedInboxClass(child) {
|
||||||
const { type } = child;
|
const { type, phoneNumber } = child;
|
||||||
const classByType = getInboxClassByType(type);
|
const classByType = getInboxClassByType(type, phoneNumber);
|
||||||
return classByType;
|
return classByType;
|
||||||
},
|
},
|
||||||
newLinkClick() {
|
newLinkClick() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue