chore: Fix issue with compose conversation form (#10991)
This commit is contained in:
@@ -105,6 +105,7 @@ export default {
|
||||
currentUser: 'getCurrentUser',
|
||||
globalConfig: 'globalConfig/get',
|
||||
messageSignature: 'getMessageSignature',
|
||||
inboxesList: 'inboxes/getInboxes',
|
||||
}),
|
||||
sendWithSignature() {
|
||||
return this.fetchSignatureFlagFromUISettings(this.channelType);
|
||||
@@ -139,13 +140,29 @@ export default {
|
||||
selectedInbox: {
|
||||
get() {
|
||||
const inboxList = this.contact.contact_inboxes || [];
|
||||
return (
|
||||
inboxList.find(inbox => {
|
||||
return inbox.inbox?.id && inbox.inbox?.id === this.targetInbox?.id;
|
||||
}) || {
|
||||
inbox: {},
|
||||
}
|
||||
const selectedContactInbox = inboxList.find(
|
||||
inbox => inbox.inbox?.id && inbox.inbox?.id === this.targetInbox?.id
|
||||
);
|
||||
|
||||
if (!selectedContactInbox) {
|
||||
return { inbox: {} };
|
||||
}
|
||||
|
||||
// Find the matching inbox from the inboxesList
|
||||
const matchingInbox =
|
||||
this.inboxesList.find(
|
||||
item => item.id === selectedContactInbox.inbox?.id
|
||||
) || {};
|
||||
|
||||
// The entire inbox payload is not available in this object, so we need to patch it from the store
|
||||
return {
|
||||
...selectedContactInbox,
|
||||
inbox: {
|
||||
...matchingInbox,
|
||||
...selectedContactInbox.inbox,
|
||||
sourceId: selectedContactInbox.source_id || matchingInbox.sourceId,
|
||||
},
|
||||
};
|
||||
},
|
||||
set(value) {
|
||||
this.targetInbox = value.inbox;
|
||||
@@ -165,12 +182,22 @@ export default {
|
||||
? this.$t('CONVERSATION.FOOTER.DISABLE_SIGN_TOOLTIP')
|
||||
: this.$t('CONVERSATION.FOOTER.ENABLE_SIGN_TOOLTIP');
|
||||
},
|
||||
|
||||
inboxes() {
|
||||
const inboxList = this.contact.contact_inboxes || [];
|
||||
return inboxList.map(inbox => ({
|
||||
...inbox.inbox,
|
||||
sourceId: inbox.source_id,
|
||||
}));
|
||||
if (!inboxList.length) return [];
|
||||
|
||||
return inboxList.map(inbox => {
|
||||
const matchingInbox =
|
||||
this.inboxesList.find(item => item.id === inbox.inbox?.id) || {};
|
||||
|
||||
// Create merged object with a clear property order
|
||||
return {
|
||||
...matchingInbox,
|
||||
...inbox.inbox,
|
||||
sourceId: inbox.source_id,
|
||||
};
|
||||
});
|
||||
},
|
||||
isAnEmailInbox() {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user