Merge pull request #236 from groombook/fix/gro-493-oobe-loop
fix(web): resolve OOBE loop after setup completion (GRO-494)
This commit was merged in pull request #236.
This commit is contained in:
@@ -231,7 +231,7 @@ export function App() {
|
|||||||
if (location.pathname === "/setup") {
|
if (location.pathname === "/setup") {
|
||||||
return (
|
return (
|
||||||
<BrandingProvider>
|
<BrandingProvider>
|
||||||
<SetupWizard />
|
<SetupWizard onSetupComplete={() => setNeedsSetup(false)} />
|
||||||
</BrandingProvider>
|
</BrandingProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useState, useEffect } from "react";
|
|||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useBranding } from "../BrandingContext.js";
|
import { useBranding } from "../BrandingContext.js";
|
||||||
|
|
||||||
export function SetupWizard() {
|
export function SetupWizard({ onSetupComplete }) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { refresh: refreshBranding } = useBranding();
|
const { refresh: refreshBranding } = useBranding();
|
||||||
|
|
||||||
@@ -160,6 +160,8 @@ export function SetupWizard() {
|
|||||||
}
|
}
|
||||||
// Refresh branding so the nav bar shows the new business name
|
// Refresh branding so the nav bar shows the new business name
|
||||||
refreshBranding();
|
refreshBranding();
|
||||||
|
// Clear needsSetup state in App so the redirect to /admin sticks
|
||||||
|
if (onSetupComplete) onSetupComplete();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setError("Network error. Please try again.");
|
setError("Network error. Please try again.");
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user