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:
Sivin Varghese
2025-05-06 04:56:30 +05:30
committed by GitHub
parent bfed849d6a
commit 6b42305f59

View File

@@ -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 ?? '',
};
});