FIX PR Problems

This commit is contained in:
firewookie
2026-03-10 15:42:56 +05:00
parent 97ce8d751c
commit 9467a08861
2 changed files with 6 additions and 4 deletions

View File

@@ -94,9 +94,13 @@ export default function Balance() {
queryFn: balanceApi.getPaymentMethods,
});
// Deferred: only fetch saved cards after payment methods loaded to avoid extra request on first render.
// The recurrent_enabled flag is cached for 5 min to prevent refetching on every Balance visit.
const { data: savedCardsData } = useQuery({
queryKey: ['saved-cards'],
queryFn: balanceApi.getSavedCards,
enabled: !!paymentMethods,
staleTime: 5 * 60 * 1000,
});
const normalizeType = (type: string) => type?.toUpperCase?.() ?? type;

View File

@@ -469,8 +469,7 @@ export default function TopUpAmount() {
{/* Error message */}
{error && (
<motion.div
initial={{ opacity: 0, y: 8 }}
animate={{ opacity: 1, y: 0 }}
variants={staggerItem}
className="flex items-center gap-2 rounded-xl border border-error-500/20 bg-error-500/10 p-3"
>
<svg
@@ -493,8 +492,7 @@ export default function TopUpAmount() {
{/* Payment link display - shown when URL is received */}
{paymentUrl && (
<motion.div
initial={{ opacity: 0, y: 8 }}
animate={{ opacity: 1, y: 0 }}
variants={staggerItem}
className="space-y-3 rounded-2xl border border-success-500/20 bg-success-500/10 p-4"
>
<div className="flex items-center gap-2 text-success-400">