From 812e976696257c50ec405113267693d16facd4f0 Mon Sep 17 00:00:00 2001 From: arvinxx Date: Sat, 5 Aug 2023 15:29:59 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style:=20=E4=BF=AE=E6=AD=A3=20as?= =?UTF-8?q?sistant=20=E6=B6=88=E6=81=AF=E6=B2=A1=E6=9C=89=20background=20?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #42 --- src/store/session/slices/chat/selectors/chat.ts | 1 + src/store/session/slices/chat/selectors/utils.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/store/session/slices/chat/selectors/chat.ts b/src/store/session/slices/chat/selectors/chat.ts index 7ee69a3d7672..9e7fb7476a45 100644 --- a/src/store/session/slices/chat/selectors/chat.ts +++ b/src/store/session/slices/chat/selectors/chat.ts @@ -19,6 +19,7 @@ export const getChatsById = session, { assistant: agentSelectors.currentAgentAvatar(s), + assistantBackground: agentSelectors.currentAgentBackgroundColor(s), user: useSettings.getState().settings.avatar || DEFAULT_USER_AVATAR, }, s.activeTopicId, diff --git a/src/store/session/slices/chat/selectors/utils.ts b/src/store/session/slices/chat/selectors/utils.ts index c8854741a845..075cad9572cc 100644 --- a/src/store/session/slices/chat/selectors/utils.ts +++ b/src/store/session/slices/chat/selectors/utils.ts @@ -4,7 +4,7 @@ import { LobeAgentSession } from '@/types/session'; export const organizeChats = ( session: LobeAgentSession, - avatar: { assistant: string; user: string }, + avatar: { assistant: string; assistantBackground?: string; user: string }, topicId?: string, ) => { const getMeta = (message: ChatMessage) => { @@ -22,6 +22,7 @@ export const organizeChats = ( case 'assistant': { return { avatar: avatar.assistant, + backgroundColor: avatar.assistantBackground, title: session.meta.title, }; }