mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 17:30:16 +01:00
fix: fix conversations in nav (put refreshConvoHint back)
This commit is contained in:
parent
dd0a91a9f6
commit
573112de7b
5 changed files with 8 additions and 16 deletions
|
|
@ -4,7 +4,6 @@ import { useUpdateConversationMutation } from '~/data-provider';
|
|||
import RenameButton from './RenameButton';
|
||||
import DeleteButton from './DeleteButton';
|
||||
import ConvoIcon from '../svg/ConvoIcon';
|
||||
import manualSWR from '~/utils/fetchers';
|
||||
|
||||
import store from '~/store';
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export default function Nav({ navVisible, setNavVisible }) {
|
|||
const conversation = useRecoilValue(store.conversation);
|
||||
const { conversationId } = conversation || {};
|
||||
const setSearchResultMessages = useSetRecoilState(store.searchResultMessages);
|
||||
|
||||
const refreshConversationsHint = useRecoilValue(store.refreshConversationsHint);
|
||||
const { refreshConversations } = store.useConversations();
|
||||
|
||||
const [isFetching, setIsFetching] = useState(false);
|
||||
|
|
@ -112,6 +112,12 @@ export default function Nav({ navVisible, setNavVisible }) {
|
|||
}
|
||||
}, [getConversationsQuery.isSuccess, getConversationsQuery.data, isSearching, pageNumber]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isSearching) {
|
||||
getConversationsQuery.refetch();
|
||||
}
|
||||
}, [pageNumber, conversationId, refreshConversationsHint]);
|
||||
|
||||
const moveToTop = () => {
|
||||
const container = containerRef.current;
|
||||
if (container) {
|
||||
|
|
|
|||
|
|
@ -2,10 +2,6 @@ import * as t from './types';
|
|||
import request from './request';
|
||||
import * as endpoints from './endpoints';
|
||||
|
||||
export function getOpenAIModels(): Promise<t.TOpenAIModels> {
|
||||
return request.get(endpoints.openAiModels());
|
||||
}
|
||||
|
||||
export function postAICompletion(payload: t.TAICompletionRequest) {
|
||||
return request.post(endpoints.getAICompletion(), payload);
|
||||
}
|
||||
|
|
@ -19,10 +15,6 @@ export function deleteConversation(payload: t.TDeleteConversationRequest) {
|
|||
return request.post(endpoints.deleteConversation(), payload);
|
||||
}
|
||||
|
||||
export function clearAllConversations() {
|
||||
return request.post(endpoints.deleteConversation());
|
||||
}
|
||||
|
||||
export function getMessagesByConvoId(id: string): Promise<t.TMessage[]> {
|
||||
return request.get(endpoints.getMessages(id));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ export const useGetConversationByIdQuery = (
|
|||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
refetchOnMount: false,
|
||||
enabled: false,
|
||||
...config
|
||||
}
|
||||
);
|
||||
|
|
@ -148,7 +147,7 @@ export const useClearConversationsMutation = (): UseMutationResult<unknown> => {
|
|||
export const useGetConversationsQuery = (pageNumber: string): QueryObserverResult<t.TGetConversationsResponse> => {
|
||||
return useQuery([QueryKeys.allConversations, pageNumber], () =>
|
||||
dataService.getConversations(pageNumber), {
|
||||
refetchOnWindowFocus: false,
|
||||
// refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
refetchOnMount: false,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,10 +186,6 @@ export type TDeleteCustomGptRequest = {
|
|||
|
||||
export type TDeleteCustomGptResponse = {};
|
||||
|
||||
export type TClearConversationsRequest = {};
|
||||
|
||||
export type TClearConversationsResponse = {};
|
||||
|
||||
export type TGetCustomGptsResponse = {};
|
||||
|
||||
export type TSearchResults = {};
|
||||
Loading…
Add table
Add a link
Reference in a new issue