From 7237669b14ed4fd963c7c9c467cba5398cf1ceb0 Mon Sep 17 00:00:00 2001 From: Sluijsens Date: Mon, 22 Jun 2026 11:25:40 +0200 Subject: [PATCH] fix(setup): Apply language choice and fix post-setup redirect - Call changeLanguage(values.language) after successful owner creation so the UI immediately switches to the language the owner chose - Call _markSystemInitialized() to update the router cache before navigating to /login; without this the guard saw initialized=false and redirected back to /setup, blocking the redirect Co-Authored-By: Claude Haiku 4.5 --- frontend/src/pages/SetupPage.tsx | 4 ++++ frontend/src/router.tsx | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/frontend/src/pages/SetupPage.tsx b/frontend/src/pages/SetupPage.tsx index dd174db..4352f82 100644 --- a/frontend/src/pages/SetupPage.tsx +++ b/frontend/src/pages/SetupPage.tsx @@ -12,6 +12,8 @@ import { FormErrorBanner } from '@/components/ui/FormErrorBanner'; import { FieldError } from '@/components/ui/FieldError'; import { useSetup } from '@/api/useSetup'; import { ProblemDetailsError, NetworkError } from '@/lib/api-client'; +import { changeLanguage } from '@/i18n/config'; +import { _markSystemInitialized } from '@/router'; interface FormError { message: string; @@ -47,6 +49,8 @@ export function SetupPage() { try { const { confirmPassword: _, ...payload } = values; await setupMutation.mutateAsync(payload); + await changeLanguage(values.language); + _markSystemInitialized(); setSuccessMessage(true); setTimeout(() => { navigate({ to: '/login' }); diff --git a/frontend/src/router.tsx b/frontend/src/router.tsx index 482fdff..3dbf2e6 100644 --- a/frontend/src/router.tsx +++ b/frontend/src/router.tsx @@ -50,6 +50,11 @@ export function _resetSetupStatusCache(): void { _setupStatusPromise = null; } +export function _markSystemInitialized(): void { + _setupStatusCache = { initialized: true }; + _setupStatusPromise = null; +} + function RouteFallback() { return (