Skip to content

Commit adcbf4b

Browse files
committed
feat: also change user default chat model when change room chat model
Signed-off-by: BobDu <i@bobdu.cc>
1 parent a4422c2 commit adcbf4b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/store/modules/chat/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
fetchRenameChatRoom,
1313
fetchUpdateChatRoomChatModel,
1414
fetchUpdateChatRoomUsingContext,
15+
fetchUpdateUserChatModel,
1516
} from '@/api'
1617

1718
export const useChatStore = defineStore('chat-store', {
@@ -107,6 +108,9 @@ export const useChatStore = defineStore('chat-store', {
107108

108109
async setChatModel(chatModel: string, roomId: number) {
109110
await fetchUpdateChatRoomChatModel(chatModel, roomId)
111+
const userStore = useUserStore()
112+
userStore.userInfo.config.chatModel = chatModel
113+
await fetchUpdateUserChatModel(chatModel)
110114
},
111115

112116
async addHistory(history: Chat.History, chatData: Chat.Chat[] = []) {

0 commit comments

Comments
 (0)