diff --git a/app/controllers/api/v1/accounts/contacts/conversations_controller.rb b/app/controllers/api/v1/accounts/contacts/conversations_controller.rb index 5e0a0e55e..de0ac4db9 100644 --- a/app/controllers/api/v1/accounts/contacts/conversations_controller.rb +++ b/app/controllers/api/v1/accounts/contacts/conversations_controller.rb @@ -2,7 +2,7 @@ class Api::V1::Accounts::Contacts::ConversationsController < Api::V1::Accounts:: def index @conversations = Current.account.conversations.includes( :assignee, :contact, :inbox, :taggings - ).where(inbox_id: inbox_ids, contact_id: @contact.id).order(id: :desc).limit(20) + ).where(inbox_id: inbox_ids, contact_id: @contact.id).order(last_activity_at: :desc).limit(20) end private diff --git a/app/javascript/dashboard/components-next/message/bubbles/Email/EmailMeta.vue b/app/javascript/dashboard/components-next/message/bubbles/Email/EmailMeta.vue index d2a48290b..f4b863e64 100644 --- a/app/javascript/dashboard/components-next/message/bubbles/Email/EmailMeta.vue +++ b/app/javascript/dashboard/components-next/message/bubbles/Email/EmailMeta.vue @@ -26,7 +26,18 @@ const ccEmail = computed(() => { }); const senderName = computed(() => { - return sender.value.name ?? ''; + const fromEmailAddress = fromEmail.value[0] ?? ''; + const senderEmail = sender.value.email ?? ''; + + if (!fromEmailAddress && !senderEmail) return null; + + // if the sender of the conversation and the sender of this particular + // email are the same, only then we return the sender name + if (fromEmailAddress === senderEmail) { + return sender.value.name; + } + + return null; }); const bccEmail = computed(() => { @@ -59,11 +70,19 @@ const showMeta = computed(() => { :class="hasError ? 'text-n-ruby-11' : 'text-n-slate-11'" >