play admin tour after admin login, play tool tour after user login

This commit is contained in:
EthanHealy01
2025-11-10 14:48:49 +00:00
parent 2f0be9ff09
commit 2b62852648
2 changed files with 7 additions and 9 deletions

View File

@@ -20,8 +20,7 @@ export default function InitialOnboardingModal({ opened, onClose }: InitialOnboa
const [step, setStep] = React.useState(0);
const totalSteps = 3;
const { config } = useAppConfig();
// NOTE: For testing, this is forced to true. Revert to config?.isAdmin for production.
const isAdmin = true; // TODO: revert to !!config?.isAdmin
const isAdmin = !!config?.isAdmin;
React.useEffect(() => {
if (!opened) setStep(0);
@@ -212,10 +211,9 @@ export default function InitialOnboardingModal({ opened, onClose }: InitialOnboa
// Otherwise, start immediately (if not completed previously)
if (!preferences.hasCompletedOnboarding) {
if (isAdmin) {
// TODO: Change to admin tour once available
startTour();
startTour('admin');
} else {
startTour();
startTour('tools');
}
}
}}

View File

@@ -14,7 +14,8 @@ const ToolPanelModePrompt = () => {
const { preferences, updatePreference } = usePreferences();
const { startTour, startAfterToolModeSelection, setStartAfterToolModeSelection, setShowWelcomeModal } = useOnboarding();
const [opened, setOpened] = useState(false);
const isAdmin = true; // TODO: revert to !!config?.isAdmin
const { config } = useAppConfig();
const isAdmin = !!config?.isAdmin;
// Only show after the new 3-slide onboarding has been completed
const shouldShowPrompt = !preferences.toolPanelModePromptSeen && preferences.hasSeenIntroOnboarding;
@@ -36,10 +37,9 @@ const ToolPanelModePrompt = () => {
setShowWelcomeModal(false);
setStartAfterToolModeSelection(false);
if (isAdmin) {
// TODO: Change to admin tour once available
startTour();
startTour('admin');
} else {
startTour();
startTour('tools');
}
}
};