fixed bug where earnings would show set up before disappearing even when user has stripePayoutsEnabled

This commit is contained in:
jackiettran
2026-01-12 17:44:53 -05:00
parent 6c9fd8aec2
commit c2ebe8709d

View File

@@ -127,9 +127,14 @@ const EarningsDashboard: React.FC = () => {
const isOnboardingComplete = accountStatus?.detailsSubmitted ?? false;
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
const showSetupCard =
!hasStripeAccount || !isOnboardingComplete || !payoutsEnabled;
!accountStatusLoading &&
(!hasStripeAccount || !isOnboardingComplete || !payoutsEnabled);
return (
<div className="container mt-4">