diff --git a/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue b/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue index a2efc93db..ea5e31c77 100644 --- a/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue +++ b/app/javascript/dashboard/components/widgets/conversation/MessagesView.vue @@ -36,6 +36,7 @@ import { REPLY_POLICY } from 'shared/constants/links'; import wootConstants from 'dashboard/constants/globals'; import { LOCAL_STORAGE_KEYS } from 'dashboard/constants/localStorage'; import { FEATURE_FLAGS } from '../../../featureFlags'; +import { INBOX_TYPES } from 'dashboard/helper/inbox'; import NextButton from 'dashboard/components-next/button/Button.vue'; @@ -209,6 +210,17 @@ export default { return contactLastSeenAt; }, + // Check there is a facebook inbox with the same instagram_id + hasDuplicateInstagramInbox() { + const instagramId = this.inbox.instagram_id; + const facebookInbox = + this.$store.getters['inboxes/getFacebookInboxByInstagramId']( + instagramId + ); + + return this.inbox.channel_type === INBOX_TYPES.FB && facebookInbox; + }, + replyWindowBannerMessage() { if (this.isAWhatsAppChannel) { return this.$t('CONVERSATION.TWILIO_WHATSAPP_CAN_REPLY'); @@ -503,6 +515,12 @@ export default { :href-link="replyWindowLink" :href-link-text="replyWindowLinkText" /> +
import EmptyState from '../../../../components/widgets/EmptyState.vue'; import NextButton from 'dashboard/components-next/button/Button.vue'; - +import DuplicateInboxBanner from './channels/instagram/DuplicateInboxBanner.vue'; +import { INBOX_TYPES } from 'dashboard/helper/inbox'; export default { components: { EmptyState, NextButton, + DuplicateInboxBanner, }, computed: { currentInbox() { @@ -16,6 +18,20 @@ export default { isATwilioInbox() { return this.currentInbox.channel_type === 'Channel::TwilioSms'; }, + // Check if a facebook inbox that has the same instagram_id + hasDuplicateInstagramInbox() { + const instagramId = this.currentInbox.instagram_id; + const facebookInbox = + this.$store.getters['inboxes/getFacebookInboxByInstagramId']( + instagramId + ); + + return ( + this.currentInbox.channel_type === INBOX_TYPES.INSTAGRAM && + facebookInbox + ); + }, + isAEmailInbox() { return this.currentInbox.channel_type === 'Channel::Email'; }, @@ -72,8 +88,12 @@ export default {