mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
fix: prevent convo overwrite on convo refresh and combine with remote models handling (#1217)
This commit is contained in:
parent
ebe62ad250
commit
4dab094855
2 changed files with 15 additions and 11 deletions
|
|
@ -9,13 +9,12 @@ import {
|
|||
} from 'librechat-data-provider';
|
||||
import type { ContextType } from '~/common';
|
||||
import { Nav, MobileNav } from '~/components/Nav';
|
||||
import { useAuthContext, useServerStream, useConversation, useNewConvo } from '~/hooks';
|
||||
import { useAuthContext, useServerStream, useConversation } from '~/hooks';
|
||||
import store from '~/store';
|
||||
|
||||
export default function Root() {
|
||||
const location = useLocation();
|
||||
const { newConversation } = useConversation();
|
||||
const { newConversation: newConvo } = useNewConvo();
|
||||
const { user, isAuthenticated } = useAuthContext();
|
||||
const [navVisible, setNavVisible] = useState(() => {
|
||||
const savedNavVisible = localStorage.getItem('navVisible');
|
||||
|
|
@ -44,7 +43,6 @@ export default function Root() {
|
|||
newConversation({}, undefined, modelsQuery.data);
|
||||
} else if (modelsQuery.data) {
|
||||
setModelsConfig(modelsQuery.data);
|
||||
newConvo({ modelsData: modelsQuery.data });
|
||||
} else if (modelsQuery.isError) {
|
||||
console.error('Failed to get models', modelsQuery.error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue