fixed bug where earnings would show set up before disappearing even when user has stripePayoutsEnabled
This commit is contained in:
@@ -127,9 +127,14 @@ const EarningsDashboard: React.FC = () => {
|
|||||||
const isOnboardingComplete = accountStatus?.detailsSubmitted ?? false;
|
const isOnboardingComplete = accountStatus?.detailsSubmitted ?? false;
|
||||||
const payoutsEnabled = accountStatus?.payoutsEnabled ?? true;
|
const payoutsEnabled = accountStatus?.payoutsEnabled ?? true;
|
||||||
|
|
||||||
|
// Don't show setup card until we have account status (if user has a Stripe account)
|
||||||
|
// This prevents the setup card from flashing briefly while fetching account status
|
||||||
|
const accountStatusLoading = hasStripeAccount && accountStatus === null;
|
||||||
|
|
||||||
// Show setup card if: no account, onboarding incomplete, or payouts disabled
|
// Show setup card if: no account, onboarding incomplete, or payouts disabled
|
||||||
const showSetupCard =
|
const showSetupCard =
|
||||||
!hasStripeAccount || !isOnboardingComplete || !payoutsEnabled;
|
!accountStatusLoading &&
|
||||||
|
(!hasStripeAccount || !isOnboardingComplete || !payoutsEnabled);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container mt-4">
|
<div className="container mt-4">
|
||||||
|
|||||||
Reference in New Issue
Block a user