Skip to content

Commit ed2bf68

Browse files
authored
fix: hide setup banner if any custom providers are configured (dyad-sh#1756)
Fixes dyad-sh#1108 ## Summary The "Setup AI Access" banner was not being hidden when custom providers were configured. This was because the `isAnyProviderSetup()` function only checked hardcoded cloud providers and didn't account for custom providers. ## Changes Updated `useLanguageModelProviders.ts` to check for configured custom providers in addition to the hardcoded cloud providers. ## Test plan - Configure a custom provider without setting up any cloud providers - Verify that the "Setup AI Access" banner is now hidden 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Hide the "Setup AI Access" banner when any provider is configured, including custom providers. Fixes a logic gap where only hardcoded cloud providers were checked. - **Bug Fixes** - Extend isAnyProviderSetup to check custom providers from query data (by id). - Banner no longer shows when a custom provider is configured without cloud providers. <sup>Written for commit 2ecef7a. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
1 parent 8dee255 commit ed2bf68

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/hooks/useLanguageModelProviders.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,18 @@ export function useLanguageModelProviders() {
6161
};
6262

6363
const isAnyProviderSetup = () => {
64-
return cloudProviders.some((provider) => isProviderSetup(provider));
64+
// Check hardcoded cloud providers
65+
if (cloudProviders.some((provider) => isProviderSetup(provider))) {
66+
return true;
67+
}
68+
69+
// Check custom providers
70+
const customProviders = queryResult.data?.filter(
71+
(provider) => provider.type === "custom",
72+
);
73+
return (
74+
customProviders?.some((provider) => isProviderSetup(provider.id)) ?? false
75+
);
6576
};
6677

6778
return {

0 commit comments

Comments
 (0)