Admin package summary sheet
This commit is contained in:
@@ -15,7 +15,6 @@ import {
|
||||
ADMIN_WELCOME_BASE_PATH,
|
||||
} from './constants';
|
||||
import { fetchOnboardingStatus, getTenantPackagesOverview } from './api';
|
||||
import { getSelectedPackageId } from './mobile/lib/onboardingSelection';
|
||||
import { resolveOnboardingRedirect } from './mobile/lib/onboardingGuard';
|
||||
const AuthCallbackPage = React.lazy(() => import('./mobile/AuthCallbackPage'));
|
||||
const LoginStartPage = React.lazy(() => import('./mobile/LoginStartPage'));
|
||||
@@ -56,7 +55,6 @@ function RequireAuth() {
|
||||
const { status, user } = useAuth();
|
||||
const location = useLocation();
|
||||
const { hasEvents, isLoading: eventsLoading } = useEventContext();
|
||||
const selectedPackageId = getSelectedPackageId();
|
||||
const isWelcomePath = location.pathname.startsWith(ADMIN_WELCOME_BASE_PATH);
|
||||
const isBillingPath = location.pathname.startsWith(ADMIN_BILLING_PATH);
|
||||
const isTenantAdmin = Boolean(user && user.role !== 'member');
|
||||
@@ -79,6 +77,7 @@ function RequireAuth() {
|
||||
|
||||
const hasActivePackage =
|
||||
Boolean(packagesData?.activePackage) || Boolean(packagesData?.packages?.some((pkg) => pkg.active));
|
||||
const remainingEvents = packagesData?.activePackage?.remaining_events ?? null;
|
||||
const isOnboardingDismissed = Boolean(onboardingStatus?.steps?.dismissed_at);
|
||||
const isOnboardingCompleted = Boolean(onboardingStatus?.steps?.completed_at);
|
||||
const shouldBlockOnboarding = shouldCheckPackages && onboardingLoading;
|
||||
@@ -86,9 +85,8 @@ function RequireAuth() {
|
||||
const redirectTarget = resolveOnboardingRedirect({
|
||||
hasEvents,
|
||||
hasActivePackage,
|
||||
selectedPackageId,
|
||||
remainingEvents,
|
||||
pathname: location.pathname,
|
||||
isWelcomePath,
|
||||
isBillingPath,
|
||||
isOnboardingDismissed,
|
||||
isOnboardingCompleted,
|
||||
|
||||
Reference in New Issue
Block a user