mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-09 19:14:23 +01:00
fix(balance/models): request only when authenticated, modelsQuery "optimistic" update (#1031)
* fix(balanceQuery/modelsQuery): request only when authenticated * style: match new chat capitalization to official * fix(modelsQuery): update selected model optimistically * ci: update e2e changes, disable title in ci env * fix(ci): get new chat button by data-testid and not text
This commit is contained in:
parent
2dd545eaa4
commit
b3aac97710
10 changed files with 34 additions and 15 deletions
|
|
@ -105,7 +105,7 @@ export const getAIEndpoints = () => {
|
|||
return request.get(endpoints.aiEndpoints());
|
||||
};
|
||||
|
||||
export const getModels = () => {
|
||||
export const getModels = async (): Promise<t.TModelsConfig> => {
|
||||
return request.get(endpoints.models());
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -238,11 +238,14 @@ export const useGetEndpointsQuery = (): QueryObserverResult<t.TEndpointsConfig>
|
|||
});
|
||||
};
|
||||
|
||||
export const useGetModelsQuery = (): QueryObserverResult<t.TModelsConfig> => {
|
||||
return useQuery([QueryKeys.models], () => dataService.getModels(), {
|
||||
export const useGetModelsQuery = (
|
||||
config?: UseQueryOptions<t.TModelsConfig>,
|
||||
): QueryObserverResult<t.TModelsConfig> => {
|
||||
return useQuery<t.TModelsConfig>([QueryKeys.models], () => dataService.getModels(), {
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
refetchOnMount: false,
|
||||
...config,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue