Skip to content

Commit

Permalink
Fix outdated comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Amnish04 committed Nov 11, 2024
1 parent ff06b96 commit 8ff93af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hooks/use-models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ export const ModelsProvider: FC<{ children: ReactNode }> = ({ children }) => {
const providers = Object.values(settings.providers); // Get all providers

if (isFetchingAllProvidersWithModels.current) {
return; // Return early if there's no API key or we're already fetching
return; // Return early if we're already fetching
}

const fetchModelsForAllProviders = async () => {
isFetchingAllProvidersWithModels.current = true;
try {
// Fetch models for all providers concurrently
const fetchPromises = providers.map((provider) => {
if (!provider.apiKey) return Promise.resolve([]); // Skip providers without an apiKey
// Skip providers without an apiKey
if (!provider.apiKey) return Promise.resolve([]);

return provider.queryModels(provider.apiKey).then((models) => {
return {
Expand Down

0 comments on commit 8ff93af

Please sign in to comment.