fix(web): resolve OOBE loop after setup completion (GRO-494) #236

Merged
groombook-engineer[bot] merged 1 commits from fix/gro-493-oobe-loop into main 2026-04-05 23:19:27 +00:00
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -231,7 +231,7 @@ export function App() {
if (location.pathname === "/setup") {
return (
<BrandingProvider>
<SetupWizard />
<SetupWizard onSetupComplete={() => setNeedsSetup(false)} />
</BrandingProvider>
);
}
+3 -1
View File
@@ -2,7 +2,7 @@ import { useState, useEffect } from "react";
import { useNavigate } from "react-router-dom";
import { useBranding } from "../BrandingContext.js";
export function SetupWizard() {
export function SetupWizard({ onSetupComplete }) {
const navigate = useNavigate();
const { refresh: refreshBranding } = useBranding();
@@ -160,6 +160,8 @@ export function SetupWizard() {
}
// Refresh branding so the nav bar shows the new business name
refreshBranding();
// Clear needsSetup state in App so the redirect to /admin sticks
if (onSetupComplete) onSetupComplete();
} catch (e) {
setError("Network error. Please try again.");
setLoading(false);