mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
FIX PR Problems
This commit is contained in:
@@ -94,9 +94,13 @@ export default function Balance() {
|
|||||||
queryFn: balanceApi.getPaymentMethods,
|
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({
|
const { data: savedCardsData } = useQuery({
|
||||||
queryKey: ['saved-cards'],
|
queryKey: ['saved-cards'],
|
||||||
queryFn: balanceApi.getSavedCards,
|
queryFn: balanceApi.getSavedCards,
|
||||||
|
enabled: !!paymentMethods,
|
||||||
|
staleTime: 5 * 60 * 1000,
|
||||||
});
|
});
|
||||||
|
|
||||||
const normalizeType = (type: string) => type?.toUpperCase?.() ?? type;
|
const normalizeType = (type: string) => type?.toUpperCase?.() ?? type;
|
||||||
|
|||||||
@@ -469,8 +469,7 @@ export default function TopUpAmount() {
|
|||||||
{/* Error message */}
|
{/* Error message */}
|
||||||
{error && (
|
{error && (
|
||||||
<motion.div
|
<motion.div
|
||||||
initial={{ opacity: 0, y: 8 }}
|
variants={staggerItem}
|
||||||
animate={{ opacity: 1, y: 0 }}
|
|
||||||
className="flex items-center gap-2 rounded-xl border border-error-500/20 bg-error-500/10 p-3"
|
className="flex items-center gap-2 rounded-xl border border-error-500/20 bg-error-500/10 p-3"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -493,8 +492,7 @@ export default function TopUpAmount() {
|
|||||||
{/* Payment link display - shown when URL is received */}
|
{/* Payment link display - shown when URL is received */}
|
||||||
{paymentUrl && (
|
{paymentUrl && (
|
||||||
<motion.div
|
<motion.div
|
||||||
initial={{ opacity: 0, y: 8 }}
|
variants={staggerItem}
|
||||||
animate={{ opacity: 1, y: 0 }}
|
|
||||||
className="space-y-3 rounded-2xl border border-success-500/20 bg-success-500/10 p-4"
|
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">
|
<div className="flex items-center gap-2 text-success-400">
|
||||||
|
|||||||
Reference in New Issue
Block a user