diff --git a/apps/chat/src/components/Chatbar/ModelIcon.tsx b/apps/chat/src/components/Chatbar/ModelIcon.tsx index f4e9feffe7..90d055c6ea 100644 --- a/apps/chat/src/components/Chatbar/ModelIcon.tsx +++ b/apps/chat/src/components/Chatbar/ModelIcon.tsx @@ -4,6 +4,8 @@ import SVG from 'react-inlinesvg'; import classNames from 'classnames'; import { getOpenAIEntityFullName } from '@/src/utils/app/conversation'; +import { constructPath } from '@/src/utils/app/file'; +import { isApplicationId } from '@/src/utils/app/id'; import { getThemeIconUrl } from '@/src/utils/app/themes'; import { EntityType } from '@/src/types/common'; @@ -34,6 +36,16 @@ const ModelIconTemplate = memo( : getThemeIconUrl('default-model'); const description = entity ? getOpenAIEntityFullName(entity) : entityId; + const getIconUrl = (entity: DialAIEntity | undefined) => { + if (!entity?.iconUrl) return ''; + + if (isApplicationId(entity.id)) { + return constructPath('api', entity.iconUrl); + } + + return `${getThemeIconUrl(entity.iconUrl)}?v2`; + }; + return ( = ({ const newFile = files.find((file) => file.id === selectedFileId); if (newFile) { - const newIconUrl = constructPath('api', newFile.id); - setDeleteLogo(false); - setLocalLogoFile(newIconUrl); - setValue('iconUrl', newIconUrl); + setLocalLogoFile(newFile.id); + setValue('iconUrl', newFile.id); trigger('iconUrl'); } else { setLocalLogoFile(undefined);