fix full page reload (#20625)
Co-authored-by: Sean Brydon <[email protected]>
This commit is contained in:
1 parent
3d02df3b08
commit
70eff63529
1 file changed
+3
-1
@@ -1,3 +1,4 @@
|
||||
import { useRouter } from "next/navigation";
|
||||
import type { Dispatch, SetStateAction } from "react";
|
||||
import type { UseFormReturn } from "react-hook-form";
|
||||
|
||||
@@ -19,6 +20,7 @@ export default function RoutingNavBar({
|
||||
hookForm: UseFormReturn<RoutingFormWithResponseCount>;
|
||||
setShowInfoLostDialog: Dispatch<SetStateAction<boolean>>;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const { data } = trpc.viewer.appRoutingForms.getIncompleteBookingSettings.useQuery({
|
||||
formId: form.id,
|
||||
});
|
||||
@@ -39,7 +41,7 @@ export default function RoutingNavBar({
|
||||
if (hookForm.formState.isDirty) {
|
||||
setShowInfoLostDialog(true);
|
||||
} else {
|
||||
window.location.href = `${appUrl}/route-builder/${form?.id}`;
|
||||
router.push(`${appUrl}/route-builder/${form?.id}`);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user