mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-21 01:44:09 +01:00
Build/Refactor: lint pre-commit hook and reformat repo to spec (#314)
* build/refactor: move lint/prettier packages to project root, install husky, add pre-commit hook * refactor: reformat files * build: put full eslintrc back with all rules
This commit is contained in:
parent
8d75b25104
commit
7fdc862042
157 changed files with 4836 additions and 2403 deletions
|
|
@ -61,11 +61,11 @@ export default function Chat() {
|
|||
messagesQuery.refetch(conversation?.conversationId);
|
||||
}
|
||||
}, [conversation?.conversationId, messagesQuery, messagesTree]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (messagesQuery.data) {
|
||||
setMessages(messagesQuery.data);
|
||||
} else if(messagesQuery.isError) {
|
||||
} else if (messagesQuery.isError) {
|
||||
console.error('failed to fetch the messages');
|
||||
console.error(messagesQuery.error);
|
||||
setMessages(null);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,11 @@ import { Outlet } from 'react-router-dom';
|
|||
import MessageHandler from '../components/MessageHandler';
|
||||
import Nav from '../components/Nav';
|
||||
import MobileNav from '../components/Nav/MobileNav';
|
||||
import { useGetSearchEnabledQuery, useGetEndpointsQuery, useGetPresetsQuery } from '~/data-provider';
|
||||
import {
|
||||
useGetSearchEnabledQuery,
|
||||
useGetEndpointsQuery,
|
||||
useGetPresetsQuery
|
||||
} from '~/data-provider';
|
||||
import store from '~/store';
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { useAuthContext } from '~/hooks/AuthContext';
|
||||
|
|
@ -19,7 +23,6 @@ export default function Root() {
|
|||
const endpointsQuery = useGetEndpointsQuery();
|
||||
const presetsQuery = useGetPresetsQuery({ enabled: !!user });
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (endpointsQuery.data) {
|
||||
setEndpointsConfig(endpointsQuery.data);
|
||||
|
|
@ -43,14 +46,11 @@ export default function Root() {
|
|||
console.error('Failed to get search enabled', searchEnabledQuery.error);
|
||||
}
|
||||
}, [searchEnabledQuery.data, searchEnabledQuery.isError]);
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="flex h-screen">
|
||||
<Nav
|
||||
navVisible={navVisible}
|
||||
setNavVisible={setNavVisible}
|
||||
/>
|
||||
<Nav navVisible={navVisible} setNavVisible={setNavVisible} />
|
||||
<div className="flex h-full w-full flex-1 flex-col bg-gray-50 md:pl-[260px]">
|
||||
<div className="transition-width relative flex h-full w-full flex-1 flex-col items-stretch overflow-hidden bg-white pt-10 dark:bg-gray-800 md:pt-0">
|
||||
<MobileNav setNavVisible={setNavVisible} />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue