mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
fix: Show agent bot name and avatar correctly in messages (#11394)
This PR fixes an issue where messages from the agent bot were incorrectly displayed as "BOT" with a missing avatar. It now correctly shows the agent bot’s name and avatar URL in the message list.
This commit is contained in:
@@ -394,23 +394,29 @@ function handleReplyTo() {
|
||||
}
|
||||
|
||||
const avatarInfo = computed(() => {
|
||||
if (!props.sender || props.sender.type === SENDER_TYPES.AGENT_BOT) {
|
||||
// If no sender, return bot info
|
||||
if (!props.sender) {
|
||||
return {
|
||||
name: t('CONVERSATION.BOT'),
|
||||
src: '',
|
||||
};
|
||||
}
|
||||
|
||||
if (props.sender) {
|
||||
const { sender } = props;
|
||||
const { name, type, avatarUrl, thumbnail } = sender || {};
|
||||
|
||||
// If sender type is agent bot, use avatarUrl
|
||||
if (type === SENDER_TYPES.AGENT_BOT) {
|
||||
return {
|
||||
name: props.sender.name,
|
||||
src: props.sender?.thumbnail,
|
||||
name: name ?? '',
|
||||
src: avatarUrl ?? '',
|
||||
};
|
||||
}
|
||||
|
||||
// For all other senders, use thumbnail
|
||||
return {
|
||||
name: '',
|
||||
src: '',
|
||||
name: name ?? '',
|
||||
src: thumbnail ?? '',
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user