@@ -117,11 +117,7 @@ export function createProviderDialogController(options: {
117117 provider ( ) === CONSOLE_INTEGRATION ? consoleProviderGroup ( connectionProviders ( ) ) : undefined ,
118118 )
119119
120- const firstModel = ( ) => {
121- const model = connectionGroups ( ) [ 0 ] ?. models [ 0 ]
122-
123- return model ? modelKey ( model ) : undefined
124- }
120+ const hasModels = ( ) => connectionGroups ( ) . length > 0
125121
126122 const settler = createConsoleCatalogSettler ( {
127123 isLoaded : ( ) => consoleCatalogLoaded ( connectionProviders ( ) ) ,
@@ -228,7 +224,7 @@ export function createProviderDialogController(options: {
228224 session : effect . session ,
229225 check : effect . check ,
230226 hasProblem : accountsOf ( CLAUDE_AGENT_INTEGRATION ) . problem ,
231- firstModel : firstModel ( ) ,
227+ hasModels : hasModels ( ) ,
232228 } ) ,
233229 )
234230
@@ -277,7 +273,7 @@ export function createProviderDialogController(options: {
277273 const integrationID = input . provider
278274 const isConsole = integrationID === CONSOLE_INTEGRATION
279275
280- const result = ( event : ProviderConnectEvent , catalog ?: { pending : boolean ; firstModel : string | undefined } ) =>
276+ const result = ( event : ProviderConnectEvent , catalog ?: { pending : boolean ; hasModels : boolean } ) =>
281277 dispatch ( { type : "connect.result" , session : input . session , provider : integrationID , event, catalog } )
282278
283279 if ( effect . type === "load" ) {
@@ -545,15 +541,12 @@ export function createProviderDialogController(options: {
545541 const refresh = async (
546542 effect : Extract < ProviderConnectEffect , { type : "refresh" } > ,
547543 integrationID : string ,
548- result : ( event : ProviderConnectEvent , catalog ?: { pending : boolean ; firstModel : string | undefined } ) => void ,
544+ result : ( event : ProviderConnectEvent , catalog ?: { pending : boolean ; hasModels : boolean } ) => void ,
549545 ) => {
550546 const refreshed = await sync ( )
551547
552548 if ( integrationID !== CONSOLE_INTEGRATION )
553- return result (
554- { type : "refresh.succeeded" , attempt : effect . attempt } ,
555- { pending : false , firstModel : firstModel ( ) } ,
556- )
549+ return result ( { type : "refresh.succeeded" , attempt : effect . attempt } , { pending : false , hasModels : hasModels ( ) } )
557550
558551 if ( ! refreshed )
559552 return result ( {
@@ -568,7 +561,7 @@ export function createProviderDialogController(options: {
568561 if ( outcome === "cancelled" ) return
569562 result (
570563 { type : "refresh.succeeded" , attempt : effect . attempt } ,
571- { pending : outcome === "timed-out" , firstModel : firstModel ( ) } ,
564+ { pending : outcome === "timed-out" , hasModels : hasModels ( ) } ,
572565 )
573566 }
574567
@@ -608,12 +601,9 @@ export function createProviderDialogController(options: {
608601 } )
609602
610603 createEffect (
611- on (
612- [ claudePhase , ( ) => ! ! claudeProblem ( ) , ( ) => connectionGroups ( ) . length > 0 ] ,
613- ( [ phase , hasProblem , hasModels ] ) => {
614- if ( phase ) dispatch ( { type : "claude.status.changed" , hasProblem, hasModels } )
615- } ,
616- ) ,
604+ on ( [ claudePhase , ( ) => ! ! claudeProblem ( ) , hasModels ] , ( [ phase , hasProblem , hasModels ] ) => {
605+ if ( phase ) dispatch ( { type : "claude.status.changed" , hasProblem, hasModels } )
606+ } ) ,
617607 )
618608
619609 onCleanup ( ( ) => dispatch ( { type : "disposed" } ) )
0 commit comments