mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-30 15:18:50 +01:00
refactor(Settings.jsx) move tabs to separate components, rewrite General in TS, fix react warnings
chore(client): remove unnecessary dependencies from package.json feat(client): add General tab to Settings component feat(client): add CogIcon component refactor(client): move General tab content to separate file fix(client): fix clearConvosMutation call in Settings component feat(svg): add CogIcon component refactor(conversation.js): add useCallback hook to newConversation function refactor(conversations.js): add useCallback hook to refreshConversations function chore(tsconfig.json): change jsx option to 'preserve'
This commit is contained in:
parent
f171628948
commit
544d72ee1d
10 changed files with 134 additions and 125 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import endpoints from './endpoints';
|
||||
import { useCallback } from 'react';
|
||||
import {
|
||||
atom,
|
||||
selector,
|
||||
|
|
@ -112,7 +113,7 @@ const useConversation = () => {
|
|||
);
|
||||
|
||||
|
||||
const newConversation = (template = {}, preset) => {
|
||||
const newConversation = useCallback((template = {}, preset) => {
|
||||
switchToConversation(
|
||||
{
|
||||
conversationId: 'new',
|
||||
|
|
@ -122,7 +123,7 @@ const useConversation = () => {
|
|||
[],
|
||||
preset
|
||||
);
|
||||
};
|
||||
}, [switchToConversation]);
|
||||
|
||||
const searchPlaceholderConversation = () => {
|
||||
switchToConversation(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { atom, useSetRecoilState } from 'recoil';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
const refreshConversationsHint = atom({
|
||||
key: 'refreshConversationsHint',
|
||||
|
|
@ -8,7 +9,9 @@ const refreshConversationsHint = atom({
|
|||
const useConversations = () => {
|
||||
const setRefreshConversationsHint = useSetRecoilState(refreshConversationsHint);
|
||||
|
||||
const refreshConversations = () => setRefreshConversationsHint((prevState) => prevState + 1);
|
||||
const refreshConversations = useCallback(() => {
|
||||
setRefreshConversationsHint((prevState) => prevState + 1);
|
||||
}, [setRefreshConversationsHint]);
|
||||
|
||||
return { refreshConversations };
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue