Fix defaultig to Credits tab

This commit is contained in:
Alex Gleason committed 2025-12-30 21:18:34 -06:00
1 parent 9941078da1
commit c6caeed31d
3 files changed
+11 -13

No files matched your search

+2 -4
View File
@@ -41,7 +41,6 @@ interface AIProviderConfigDialogProps {
provider: AIProvider;
onUpdate: (provider: AIProvider) => void;
onRemove: () => void;
initialTab?: 'credits' | 'edit';
}
interface Payment {
@@ -339,7 +338,6 @@ export function AIProviderConfigDialog({
provider,
onUpdate,
onRemove,
initialTab = 'credits',
}: AIProviderConfigDialogProps) {
const { t } = useTranslation();
const { user } = useCurrentUser();
@@ -378,12 +376,12 @@ export function AIProviderConfigDialog({
if (open && !isLoadingCredits) {
// Default to 'credits' tab if credits are supported, otherwise 'edit'
if (supportsCredits) {
setActiveTab(initialTab || 'credits');
setActiveTab('credits');
} else {
setActiveTab('edit');
}
}
}, [open, supportsCredits, isLoadingCredits, initialTab]);
}, [open, supportsCredits, isLoadingCredits]);
// Query for payment preview (to get fee information)
const { data: paymentPreview, isLoading: isLoadingPreview } = useQuery({