Web: Fix direct move to /wizard

This commit is contained in:
Alexey Safronov 2021-03-18 22:16:09 +03:00
parent f3f4037282
commit f9a062fd67

View File

@ -22,6 +22,17 @@ export const PublicRoute = ({ component: Component, ...rest }) => {
);
}
if (!wizardCompleted && props.location.pathname !== "/wizard") {
return (
<Redirect
to={{
pathname: "/wizard",
state: { from: props.location },
}}
/>
);
}
return <Component {...props} {...rest} />;
};
return <Route {...rest} render={renderComponent} />;