Merge PR #457: Fix onboarding loading gate for inactive subscriptions
This commit is contained in:
@@ -281,12 +281,13 @@ const InitialRouteHandler: React.FC = () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loading state - only wait for onboarding init, not subscription check
|
// Loading state - only wait for onboarding init when user has active subscription
|
||||||
// Subscription check is non-blocking and happens in background
|
// In demo mode, skip waiting for onboarding data entirely
|
||||||
// In demo mode, skip waiting for onboarding data
|
// This allows no-subscription/inactive flows to continue even when onboarding data is still null.
|
||||||
const isDemoMode = shouldSkipOnboarding();
|
const isDemoMode = shouldSkipOnboarding();
|
||||||
const waitingForOnboardingInit = !isDemoMode && (loading || !data);
|
const isActiveSubscriber = Boolean(subscription && subscription.active && subscription.plan !== 'none');
|
||||||
if (!isDemoMode && (loading || waitingForOnboardingInit)) {
|
const waitingForOnboardingInit = !isDemoMode && isActiveSubscriber && (loading || !data);
|
||||||
|
if (waitingForOnboardingInit) {
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
display="flex"
|
display="flex"
|
||||||
@@ -298,7 +299,7 @@ const InitialRouteHandler: React.FC = () => {
|
|||||||
>
|
>
|
||||||
<CircularProgress size={60} />
|
<CircularProgress size={60} />
|
||||||
<Typography variant="h6" color="textSecondary">
|
<Typography variant="h6" color="textSecondary">
|
||||||
{subscriptionLoading ? 'Checking subscription...' : 'Preparing your workspace...'}
|
Preparing your workspace...
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user