File tree Expand file tree Collapse file tree 1 file changed +8
-19
lines changed
Expand file tree Collapse file tree 1 file changed +8
-19
lines changed Original file line number Diff line number Diff line change @@ -2826,25 +2826,14 @@ const ProviderModelPicker = memo(function ProviderModelPicker(props: {
28262826 < Select
28272827 items = { items }
28282828 value = { `${ props . provider } :${ props . model } ` }
2829- onValueChange = { ( value ) =>
2830- value
2831- ? ( ( ) => {
2832- if ( value . startsWith ( "codex:" ) ) {
2833- props . onProviderModelChange (
2834- "codex" ,
2835- resolveModelSlugForProvider ( "codex" , value . slice ( "codex:" . length ) ) ,
2836- ) ;
2837- return ;
2838- }
2839- if ( value . startsWith ( "claudeCode:" ) ) {
2840- props . onProviderModelChange (
2841- "claudeCode" ,
2842- resolveModelSlugForProvider ( "claudeCode" , value . slice ( "claudeCode:" . length ) ) ,
2843- ) ;
2844- }
2845- } ) ( )
2846- : undefined
2847- }
2829+ onValueChange = { ( value ) => {
2830+ if ( ! value ) return ;
2831+ const colonIdx = value . indexOf ( ":" ) ;
2832+ if ( colonIdx === - 1 ) return ;
2833+ const provider = value . slice ( 0 , colonIdx ) as ProviderKind ;
2834+ const slug = value . slice ( colonIdx + 1 ) ;
2835+ props . onProviderModelChange ( provider , resolveModelSlugForProvider ( provider , slug ) ) ;
2836+ } }
28482837 >
28492838 < SelectTrigger size = "sm" variant = "ghost" >
28502839 < span className = "flex min-w-0 items-center gap-2" >
You can’t perform that action at this time.
0 commit comments