Updates, bug fix, prompt refactor

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2023-12-12 14:48:37 -05:00
parent 9cb2a4a021
commit a22c4bdf8c
6 changed files with 76 additions and 51 deletions

View File

@@ -9,7 +9,7 @@ function PrivateRoute({component: Component, isAuthorized, ...rest}) {
if (!isAuthorized) {
navigate(`/signin?redirect=${location.pathname}`);
}
}, [isAuthorized, navigate]);
}, [isAuthorized, navigate,location]);
return <Outlet/>;
}

View File

@@ -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");