fix full page reload (#20625)
Co-authored-by: Sean Brydon <sean@Seans-Mac-mini.local>
This commit is contained in:
co-authored by
Sean Brydon
parent
3d02df3b08
commit
70eff63529
@@ -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