Updates, bug fix, prompt refactor
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -9,7 +9,7 @@ function PrivateRoute({component: Component, isAuthorized, ...rest}) {
|
||||
if (!isAuthorized) {
|
||||
navigate(`/signin?redirect=${location.pathname}`);
|
||||
}
|
||||
}, [isAuthorized, navigate]);
|
||||
}, [isAuthorized, navigate,location]);
|
||||
|
||||
return <Outlet/>;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ export default function FormsFieldChanged({ form, skipPrompt }) {
|
||||
<Space direction="vertical" style={{ width: "100%" }}>
|
||||
<Prompt
|
||||
when={!skipPrompt}
|
||||
beforeUnload={true}
|
||||
message={(location) => {
|
||||
if (loc.pathname === location.pathname) return false;
|
||||
return t("general.messages.unsavedchangespopup");
|
||||
|
||||
Reference in New Issue
Block a user