mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-10 11:34:23 +01:00
💾 chore: Enhance Local Storage Handling and Update MCP SDK (#6809)
* feat: Update MCP package version and dependencies; refactor ToolContentPart type * refactor: Change module type to commonjs and update rollup configuration, remove unused dev dependency * refactor: Change async calls to synchronous for MCP and FlowStateManager retrieval * chore: Add eslint disable comment for i18next rule in DropdownPopup component * fix: improve statefulness of mcp servers selected if some were removed since last session * feat: implement conversation storage cleanup functions and integrate them into mutation success handlers * feat: enhance storage condition logic in useLocalStorageAlt to prevent unnecessary local storage writes * refactor: streamline local storage update logic in useLocalStorageAlt
This commit is contained in:
parent
24c0433dcf
commit
e16a6190a5
18 changed files with 420 additions and 382 deletions
|
|
@ -4,6 +4,7 @@ import { MutationKeys, QueryKeys, dataService, request } from 'librechat-data-pr
|
|||
import type { UseMutationResult } from '@tanstack/react-query';
|
||||
import type * as t from 'librechat-data-provider';
|
||||
import useClearStates from '~/hooks/Config/useClearStates';
|
||||
import { clearAllConversationStorage } from '~/utils';
|
||||
import store from '~/store';
|
||||
|
||||
/* login/logout */
|
||||
|
|
@ -79,6 +80,7 @@ export const useDeleteUserMutation = (
|
|||
onSuccess: (...args) => {
|
||||
resetDefaultPreset();
|
||||
clearStates();
|
||||
clearAllConversationStorage();
|
||||
queryClient.removeQueries();
|
||||
options?.onSuccess?.(...args);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import {
|
|||
updateConvoFields,
|
||||
updateConversation,
|
||||
deleteConversation,
|
||||
clearConversationStorage,
|
||||
} from '~/utils';
|
||||
|
||||
export type TGenTitleMutation = UseMutationResult<
|
||||
|
|
@ -562,6 +563,7 @@ export const useDeleteConversationMutation = (
|
|||
const current = queryClient.getQueryData<t.ConversationData>([QueryKeys.allConversations]);
|
||||
refetch({ refetchPage: (page, index) => index === (current?.pages.length ?? 1) - 1 });
|
||||
onSuccess?.(_data, vars, context);
|
||||
clearConversationStorage(conversationId);
|
||||
},
|
||||
..._options,
|
||||
},
|
||||
|
|
@ -897,7 +899,7 @@ export const useUploadAssistantAvatarMutation = (
|
|||
unknown // context
|
||||
> => {
|
||||
return useMutation([MutationKeys.assistantAvatarUpload], {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
||||
mutationFn: ({ postCreation, ...variables }: t.AssistantAvatarVariables) =>
|
||||
dataService.uploadAssistantAvatar(variables),
|
||||
...(options || {}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue