Skip to content

Commit fcf5ae9

Browse files
committed
refactor(claw): use isFreeModel helper for credit nudge visibility
Replace the hand-rolled Set of free model IDs with a direct call to the existing isFreeModel() helper, which already covers all free model detection cases (kilo free models, :free suffix, stealth models, etc.).
1 parent 0f9764a commit fcf5ae9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/app/(app)/claw/components/CreateInstanceCard.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { useTRPC } from '@/lib/trpc/utils';
1212
import type { ModelOption } from '@/components/shared/ModelCombobox';
1313
import { useUser } from '@/hooks/useUser';
1414
import { KILO_AUTO_FRONTIER_MODEL, KILO_AUTO_FREE_MODEL } from '@/lib/kilo-auto-model';
15+
import { isFreeModel } from '@/lib/models';
1516
import { Button } from '@/components/ui/button';
1617
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
1718
import { getCreateModelOptions } from './modelSupport';
@@ -80,6 +81,7 @@ export function CreateInstanceCard({
8081
const isPaymentReturn = searchParams.get('payment') === 'success';
8182
const hasAutoProvisioned = useRef(false);
8283

84+
8385
useEffect(() => {
8486
if (hasAppliedDefault.current || selectedModel !== '' || modelOptions.length === 0) return;
8587
if (isLoadingUser) return;
@@ -176,8 +178,7 @@ export function CreateInstanceCard({
176178
);
177179
}
178180

179-
const needsCredits =
180-
!hasCredits && selectedModel !== '' && selectedModel !== KILO_AUTO_FREE_MODEL.id;
181+
const needsCredits = !hasCredits && selectedModel !== '' && !isFreeModel(selectedModel);
181182

182183
return (
183184
<Card>

0 commit comments

Comments
 (0)