diff --git a/src/app/(app)/app/layout.tsx b/src/app/(app)/app/layout.tsx
index f8abbbb..947ab4f 100644
--- a/src/app/(app)/app/layout.tsx
+++ b/src/app/(app)/app/layout.tsx
@@ -4,16 +4,13 @@ import type { ReactNode } from 'react';
import { ConfigProvider } from '@/contexts/ConfigContext';
import { DocumentProvider } from '@/contexts/DocumentContext';
-import { DexieMigrationModal } from '@/components/documents/DexieMigrationModal';
+import { OnboardingFlowProvider } from '@/contexts/OnboardingFlowContext';
export default function AppHomeLayout({ children }: { children: ReactNode }) {
return (
- <>
- {children}
-
- >
+ {children}
);
diff --git a/src/app/(app)/layout.tsx b/src/app/(app)/layout.tsx
index fb14c2c..7cb8cb8 100644
--- a/src/app/(app)/layout.tsx
+++ b/src/app/(app)/layout.tsx
@@ -3,7 +3,6 @@ import type { ReactNode } from 'react';
import { Toaster } from 'react-hot-toast';
import { Providers } from '@/app/providers';
-import ClaimDataPopup from '@/components/auth/ClaimDataModal';
import { getAuthBaseUrl, isAnonymousAuthSessionsEnabled, isAuthEnabled, isGithubAuthEnabled } from '@/lib/server/auth/config';
export const dynamic = 'force-dynamic';
@@ -36,7 +35,6 @@ export default function AppLayout({ children }: { children: ReactNode }) {
githubAuthEnabled={githubAuthEnabled}
>
- {authEnabled && }
{children}
{
- const appConfig = await getAppConfig();
- const row = appConfig as Record | null;
- const privacyKey = ONBOARDING_STATE_REGISTRY.privacyAccepted.localKey;
- const firstVisitKey = ONBOARDING_STATE_REGISTRY.firstVisitSettingsOpened.localKey;
-
- return {
- privacyAccepted: privacyKey ? Boolean(row?.[privacyKey]) : false,
- firstVisitSettingsOpened: firstVisitKey ? Boolean(row?.[firstVisitKey]) : await getFirstVisit(),
+ useEffect(() => {
+ registerSettingsController({
+ open: openSettings,
+ close: closeSettings,
+ });
+ return () => {
+ registerSettingsController(null);
};
- }, []);
-
- const markFirstVisitSettingsOpened = useCallback(async () => {
- await setFirstVisit(true);
- }, []);
-
- const { requestOpenSettings } = useOnboardingCoordinator({
- authEnabled,
- isSessionPending,
- sessionUserId: session?.user?.id,
- appVersion: runtimeConfig.appVersion,
- isSettingsOpen: isOpen,
- readLocalSnapshot: readLocalOnboardingSnapshot,
- markFirstVisitSettingsOpened,
- postChangelogVersionCheck: async (currentVersion) => postChangelogVersionCheck(currentVersion),
- openSettings,
- closeSettings,
- });
+ }, [closeSettings, openSettings, registerSettingsController]);
useEffect(() => {
setLocalApiKey(apiKey);
@@ -530,7 +509,11 @@ export function SettingsModal({ className = '' }: { className?: string }) {
-