mirror of
https://github.com/vernu/textbee.git
synced 2026-04-29 03:03:29 -04:00
chore(web): fix contribute modal
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user