Bring back onboarding (#1414)

This commit is contained in:
lucas lelievre authored and GitHub committed 2025-04-28 14:55:52 +02:00
1 parent c8532c76c2
commit e58946f622
2 files changed
+9 -1

No files matched your search

+8 -1
View File
@@ -1,9 +1,10 @@
import { useLayoutEffect } from 'react';
import { useConfig } from './hooks/config';
import { Outlet } from 'react-router-dom';
import { Outlet, useNavigate } from 'react-router-dom';
export function AppLayout() {
const { config } = useConfig();
const navigate = useNavigate();
useLayoutEffect(() => {
if (!config) return;
@@ -26,6 +27,12 @@ export function AppLayout() {
}
}, [config]);
useLayoutEffect(() => {
if (config && !config.doneOnboarding) {
navigate('/onboarding/home');
}
}, [config?.doneOnboarding]);
return (
<>
<Outlet />
@@ -4,6 +4,7 @@ import { DEFAULT_LOCALE, LangContext } from '@/i18n/config';
import { getSentryOrCompute } from '@/utils/sentry';
const config = await loadConfig();
if (config?.errorTracking !== undefined) {
// load sentry ASAP to catch early errors
getSentryOrCompute(config.errorTracking ?? false);