diff --git a/src/components/CreditsDialog.test.tsx b/src/components/CreditsDialog.test.tsx index c5c4e74c..061e0bd1 100644 --- a/src/components/CreditsDialog.test.tsx +++ b/src/components/CreditsDialog.test.tsx @@ -80,20 +80,7 @@ describe('CreditsDialog', () => { expect(screen.getByText('$100')).toBeInTheDocument(); }); - it('shows login requirement when user is not logged in', () => { - render( - - {}} - providerId="test-provider" - connection={mockConnection} - /> - - ); - expect(screen.getByText('Please log in to purchase credits')).toBeInTheDocument(); - }); it('calls onDialogStateChange callback when dialog state changes', () => { const mockCallback = vi.fn(); diff --git a/src/components/CreditsDialog.tsx b/src/components/CreditsDialog.tsx index 2ecf72cc..7a45d96c 100644 --- a/src/components/CreditsDialog.tsx +++ b/src/components/CreditsDialog.tsx @@ -200,7 +200,7 @@ export function CreditsDialog({ open, onOpenChange, providerId, connection }: Cr const data = await ai.get('/credits/payments?limit=50') as PaymentsResponse; return data.data; }, - enabled: open && !!user, + enabled: open, retry: false, refetchOnWindowFocus: false, }); @@ -316,15 +316,6 @@ export function CreditsDialog({ open, onOpenChange, providerId, connection }: Cr }); const handleAddCredits = () => { - if (!user) { - toast({ - title: 'Authentication required', - description: 'Please log in to purchase credits.', - variant: 'destructive', - }); - return; - } - if (amount <= 0) { toast({ title: 'Invalid amount', @@ -498,7 +489,7 @@ export function CreditsDialog({ open, onOpenChange, providerId, connection }: Cr - - {!user && ( -

- Please log in to purchase credits -

- )}