From e262e23e2bf79fd7c6f3cac2e08236c0cf097baf Mon Sep 17 00:00:00 2001 From: isra el Date: Mon, 24 Feb 2025 00:20:45 +0300 Subject: [PATCH] chore(web): fix contribute modal --- web/components/shared/contribute-modal.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/web/components/shared/contribute-modal.tsx b/web/components/shared/contribute-modal.tsx index 6906950..a84c8a1 100644 --- a/web/components/shared/contribute-modal.tsx +++ b/web/components/shared/contribute-modal.tsx @@ -50,24 +50,24 @@ export function ContributeModal() { } const { - data: currentPlan, - isLoading: isLoadingPlan, - error: planError, + data: currentSubscription, + isLoading: isLoadingSubscription, + error: subscriptionError, } = useQuery({ - queryKey: ['currentPlan'], + queryKey: ['currentSubscription'], queryFn: () => httpBrowserClient - .get(ApiEndpoints.billing.currentPlan()) + .get(ApiEndpoints.billing.currentSubscription()) .then((res) => res.data), }) useEffect(() => { const checkAndShowModal = () => { - if (isLoadingPlan) return - if (planError) return + if (isLoadingSubscription) return + if (subscriptionError) return - if (currentPlan?.name?.toLowerCase() !== 'free') { + if (currentSubscription?.plan?.name?.toLowerCase() !== 'free') { return } @@ -97,7 +97,7 @@ export function ContributeModal() { checkAndShowModal() } }) - }, [currentPlan?.name, isLoadingPlan, planError]) + }, [currentSubscription?.plan?.name, isLoadingSubscription, subscriptionError]) const handleContributed = () => { localStorage.setItem(STORAGE_KEYS.HAS_CONTRIBUTED, 'true')