chore: remove credits disabled check in credits components
This commit is contained in:
parent
971b0d65a0
commit
bc4578a3cd
@ -54,11 +54,6 @@ export default function CreditsBalanceCard() {
|
||||
} | null>(null);
|
||||
const [isLoadingStats, setIsLoadingStats] = useState(true);
|
||||
|
||||
// Don't render if credits are disabled
|
||||
if (!websiteConfig.credits.enableCredits) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Fetch credit statistics
|
||||
const fetchCreditStats = useCallback(async () => {
|
||||
console.log('fetchCreditStats, fetch start');
|
||||
@ -114,6 +109,11 @@ export default function CreditsBalanceCard() {
|
||||
fetchCreditStats();
|
||||
}, [fetchCredits, fetchCreditStats]);
|
||||
|
||||
// Don't render if credits are disabled
|
||||
if (!websiteConfig.credits.enableCredits) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Render loading skeleton
|
||||
const isPageLoading = isLoadingBalance || isLoadingStats;
|
||||
if (!mounted || isPageLoading) {
|
||||
|
@ -23,11 +23,6 @@ import { CreditCheckoutButton } from './credit-checkout-button';
|
||||
* @returns Credit packages component
|
||||
*/
|
||||
export function CreditPackages() {
|
||||
// If credits are not enabled, return null
|
||||
if (!websiteConfig.credits.enableCredits) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const t = useTranslations('Dashboard.settings.credits.packages');
|
||||
|
||||
// Get current user and payment info
|
||||
@ -36,6 +31,8 @@ export function CreditPackages() {
|
||||
|
||||
// Check if user is on free plan and enableForFreePlan is false
|
||||
const isFreePlan = currentPlan?.isFree === true;
|
||||
|
||||
// Check if user is on free plan and enableForFreePlan is false
|
||||
if (isFreePlan && !websiteConfig.credits.enableForFreePlan) {
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user