Fix childer tennats
This commit is contained in:
@@ -495,13 +495,19 @@ export function DashboardPage() {
|
||||
const { plan, loading: subLoading } = subscriptionInfo;
|
||||
const tenantId = currentTenant?.id;
|
||||
|
||||
// Fetch onboarding progress
|
||||
// Check if in demo mode - demo users don't need onboarding check
|
||||
// (backend returns fully_completed=true for demo users anyway, but we skip the API call entirely)
|
||||
const isDemoMode = localStorage.getItem('demo_mode') === 'true';
|
||||
|
||||
// Fetch onboarding progress - SKIP for demo users and enterprise tier
|
||||
// Demo users are pre-configured through cloning, so onboarding is always complete
|
||||
const isAuthenticated = useIsAuthenticated();
|
||||
const { data: userProgress, isLoading: progressLoading } = useUserProgress('', {
|
||||
enabled: !!isAuthenticated && plan !== SUBSCRIPTION_TIERS.ENTERPRISE
|
||||
enabled: !!isAuthenticated && !isDemoMode && plan !== SUBSCRIPTION_TIERS.ENTERPRISE
|
||||
});
|
||||
|
||||
const loading = subLoading || progressLoading;
|
||||
// Don't wait for progressLoading if demo mode (we're not fetching it)
|
||||
const loading = subLoading || (!isDemoMode && progressLoading);
|
||||
|
||||
useEffect(() => {
|
||||
if (!loading && userProgress && !userProgress.fully_completed && plan !== SUBSCRIPTION_TIERS.ENTERPRISE) {
|
||||
|
||||
Reference in New Issue
Block a user