mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
fix: correctly pass modelsData to newConversation, also prevent navigation in this case (#1162)
This commit is contained in:
parent
5ab9802aa9
commit
efe057e0d8
2 changed files with 3 additions and 2 deletions
|
|
@ -51,7 +51,7 @@ const useConversation = () => {
|
||||||
setSubmission({} as TSubmission);
|
setSubmission({} as TSubmission);
|
||||||
resetLatestMessage();
|
resetLatestMessage();
|
||||||
|
|
||||||
if (conversation.conversationId === 'new') {
|
if (conversation.conversationId === 'new' && !modelsData) {
|
||||||
navigate('/chat/new');
|
navigate('/chat/new');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,8 @@ export default function Root() {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (modelsQuery.data) {
|
if (modelsQuery.data) {
|
||||||
setModelsConfig(modelsQuery.data);
|
setModelsConfig(modelsQuery.data);
|
||||||
newConversation(modelsQuery.data);
|
// Note: passing modelsQuery.data prevents navigation
|
||||||
|
newConversation({}, undefined, modelsQuery.data);
|
||||||
} else if (modelsQuery.isError) {
|
} else if (modelsQuery.isError) {
|
||||||
console.error('Failed to get models', modelsQuery.error);
|
console.error('Failed to get models', modelsQuery.error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue