mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 08:12:00 +02:00
🔀 fix: Endpoint Type Mismatch when Switching Conversations (#1834)
* refactor(useUpdateUserKeysMutation): only invalidate the endpoint whose key is being updated by user * fix(assistants): await `getUserKeyExpiry` call * chore: fix spinner loading color * refactor(initializeClient): make known which endpoint api Key is missing * fix: prevent an `endpointType` mismatch by making it impossible to assign when the `endpointsConfig` doesn't have a `type` defined, also prefer `getQueryData` call to useQuery in useChatHelpers
This commit is contained in:
parent
d1eb7fcfc7
commit
5291d18f38
10 changed files with 28 additions and 18 deletions
|
@ -117,8 +117,8 @@ export const useUpdateUserKeysMutation = (): UseMutationResult<
|
|||
> => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation((payload: t.TUpdateUserKeyRequest) => dataService.updateUserKey(payload), {
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries([QueryKeys.name]);
|
||||
onSuccess: (data, variables) => {
|
||||
queryClient.invalidateQueries([QueryKeys.name, variables.name]);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
@ -136,7 +136,7 @@ export const useRevokeUserKeyMutation = (name: string): UseMutationResult<unknow
|
|||
const queryClient = useQueryClient();
|
||||
return useMutation(() => dataService.revokeUserKey(name), {
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries([QueryKeys.name]);
|
||||
queryClient.invalidateQueries([QueryKeys.name, name]);
|
||||
if (name === s.EModelEndpoint.assistants) {
|
||||
queryClient.invalidateQueries([QueryKeys.assistants, defaultOrderQuery]);
|
||||
queryClient.invalidateQueries([QueryKeys.assistantDocs]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue