Skip to content

Commit 0393f7a

Browse files
committed
fix: temporary chat initial model
1 parent a0cfad1 commit 0393f7a

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

src/components/chat-bot-temporary.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@ export function ChatBotTemporary() {
3737
const t = useTranslations("Chat.TemporaryChat");
3838

3939
const [temporaryChat, appStoreMutate] = appStore(
40-
useShallow((state) => [
41-
state.temporaryChat,
42-
43-
state.mutate,
44-
]),
40+
useShallow((state) => [state.temporaryChat, state.mutate]),
4541
);
4642
const [isInstructionsOpen, setIsInstructionsOpen] = useState(false);
4743

@@ -260,6 +256,20 @@ function DrawerTemporaryContent({
260256
}
261257
}, [isLoading]);
262258

259+
useEffect(() => {
260+
if (!temporaryChat.chatModel) {
261+
appStoreMutate((state) => {
262+
if (!state.chatModel) return state;
263+
return {
264+
temporaryChat: {
265+
...temporaryChat,
266+
chatModel: state.chatModel,
267+
},
268+
};
269+
});
270+
}
271+
}, [Boolean(temporaryChat.chatModel)]);
272+
263273
return (
264274
<div
265275
className={cn("flex flex-col min-w-0 h-full flex-1 overflow-y-hidden")}

0 commit comments

Comments
 (0)