Fix childer tennats

This commit is contained in:
Urtzi Alfaro
2025-12-29 17:25:20 +01:00
parent adef7971a0
commit c1dedfa44f
5 changed files with 108 additions and 57 deletions

View File

@@ -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) {