From 727ef7d0d411586c2ca6a9f9ca9479763466d8a0 Mon Sep 17 00:00:00 2001 From: Andreas Thomas Date: Wed, 8 Jan 2025 18:52:43 +0100 Subject: [PATCH] fix: enable card correctly (#2794) the card was disabled when the remaining reached 0, which is a perfectly fine state, as long as the refill is configured to be greater than 0 as well --- .../keys/[keyAuthId]/[keyId]/settings/update-key-remaining.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/update-key-remaining.tsx b/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/update-key-remaining.tsx index 019ebebde..d15583468 100644 --- a/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/update-key-remaining.tsx +++ b/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/update-key-remaining.tsx @@ -67,7 +67,7 @@ export const UpdateKeyRemaining: React.FC = ({ apiKey }) => { delayError: 100, defaultValues: { keyId: apiKey.id, - limitEnabled: Boolean(apiKey.refillAmount), + limitEnabled: Boolean(apiKey.remaining) || Boolean(apiKey.refillAmount), remaining: apiKey.remaining ? apiKey.remaining : undefined, refill: { amount: apiKey.refillAmount ? apiKey.refillAmount : undefined,