File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import { ShareDashboardButton } from "@/components/share-dashboard-button";
66import { AppHeader } from "@/components/app-header" ;
77import { hasOpenRouterStarter } from "@/lib/openrouter" ;
88
9+ export const dynamic = "force-dynamic" ;
10+
911export default function Home ( ) {
1012 return (
1113 < div className = "flex h-screen overflow-hidden bg-zinc-900" >
Original file line number Diff line number Diff line change @@ -492,24 +492,28 @@ function useModelSelector({ hasOpenRouterStarter }: { hasOpenRouterStarter: bool
492492
493493 const provider = allProviders . find ( ( p ) => p . id === providerId ) ;
494494 const model = provider ?. models . find ( ( m ) => m . id === modelId ) ;
495+ const isOpenRouterStarterModel = providerId === OPENROUTER_PROVIDER_ID
496+ && OPENROUTER_STARTER_MODEL_IDS . has ( modelId ) ;
495497
496498 const hasSavedKey = isCustomProvider ( providerId )
497499 ? ! ! customApis . find ( ( c ) => `${ CUSTOM_PROVIDER_PREFIX } ${ c . id } ` === providerId ) ?. apiKey
498500 : ! ! apiKeys [ providerId ] ;
499- const hasStarterAccess = providerId === OPENROUTER_PROVIDER_ID && hasOpenRouterStarter ;
501+ const hasStarterAccess = isOpenRouterStarterModel && hasOpenRouterStarter ;
500502 const hasAccess = hasSavedKey || hasStarterAccess ;
501- const showOpenRouterStarterNotice = providerId === OPENROUTER_PROVIDER_ID
503+ const showOpenRouterStarterNotice = isOpenRouterStarterModel
502504 && hasOpenRouterStarter
503505 && ! hasSavedKey
504506 && ! showKeyInput ;
505507
506508 const handleSelect = ( newModel : string ) => {
507509 setModel ( newModel ) ;
508510 setOpen ( false ) ;
509- const { providerId : pid } = parseModelString ( newModel ) ;
511+ const { providerId : pid , modelId : nextModelId } = parseModelString ( newModel ) ;
512+ const isStarterOpenRouterModel = pid === OPENROUTER_PROVIDER_ID
513+ && OPENROUTER_STARTER_MODEL_IDS . has ( nextModelId ) ;
510514 if ( isCustomProvider ( pid ) ) {
511515 setShowKeyInput ( false ) ;
512- } else if ( pid === OPENROUTER_PROVIDER_ID && hasOpenRouterStarter && ! apiKeys [ pid ] ) {
516+ } else if ( isStarterOpenRouterModel && hasOpenRouterStarter && ! apiKeys [ pid ] ) {
513517 setShowKeyInput ( false ) ;
514518 } else if ( ! apiKeys [ pid ] ) {
515519 setShowKeyInput ( true ) ;
You can’t perform that action at this time.
0 commit comments