@@ -20,14 +20,17 @@ const DEFAULT_WELCOME_API_CONFIGURATION: ProviderSettings = {
2020 openRouterModelId : openRouterDefaultModelId ,
2121}
2222
23- const getWelcomeApiConfiguration = ( apiConfiguration ?: ProviderSettings ) : ProviderSettings => {
23+ const getWelcomeApiConfiguration = (
24+ apiConfiguration ?: ProviderSettings ,
25+ zooCodeIsAuthenticated ?: boolean ,
26+ ) : ProviderSettings => {
2427 // validateApiConfiguration treats a missing apiProvider as valid (no switch case matches),
2528 // so we explicitly fall back here before delegating to it for incomplete-but-set configs.
2629 if ( ! apiConfiguration ?. apiProvider ) {
2730 return DEFAULT_WELCOME_API_CONFIGURATION
2831 }
2932
30- const validationError = validateApiConfiguration ( apiConfiguration )
33+ const validationError = validateApiConfiguration ( apiConfiguration , undefined , undefined , zooCodeIsAuthenticated )
3134 if ( validationError ) {
3235 return DEFAULT_WELCOME_API_CONFIGURATION
3336 }
@@ -42,7 +45,8 @@ const WelcomeViewProvider = () => {
4245 const [ errorMessage , setErrorMessage ] = useState < string | undefined > ( undefined )
4346 const [ showProviderSetup , setShowProviderSetup ] = useState ( false )
4447 const [ welcomeApiConfiguration , setWelcomeApiConfiguration ] = useState < ProviderSettings > ( )
45- const effectiveApiConfiguration = welcomeApiConfiguration ?? getWelcomeApiConfiguration ( apiConfiguration )
48+ const effectiveApiConfiguration =
49+ welcomeApiConfiguration ?? getWelcomeApiConfiguration ( apiConfiguration , zooCodeIsAuthenticated )
4650
4751 const setApiConfigurationFieldForApiOptions = useCallback (
4852 < K extends keyof ProviderSettings > ( field : K , value : ProviderSettings [ K ] ) => {
@@ -57,7 +61,7 @@ const WelcomeViewProvider = () => {
5761
5862 const handleGetStarted = useCallback ( ( ) => {
5963 if ( ! showProviderSetup ) {
60- const initialApiConfiguration = getWelcomeApiConfiguration ( apiConfiguration )
64+ const initialApiConfiguration = getWelcomeApiConfiguration ( apiConfiguration , zooCodeIsAuthenticated )
6165 setWelcomeApiConfiguration ( initialApiConfiguration )
6266
6367 setApiConfiguration ( initialApiConfiguration )
0 commit comments