mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-03-04 02:20:19 +01:00
play admin tour after admin login, play tool tour after user login
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user