From 88db7d042f8b53843b21d890f76e333c9c671745 Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Fri, 20 Dec 2024 23:18:51 +0100 Subject: [PATCH] Use goto wrapper for cancel buttons --- frontend/src/lib/components/Forms/ModelForm.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/Forms/ModelForm.svelte b/frontend/src/lib/components/Forms/ModelForm.svelte index 97393bc4b..cfa315880 100644 --- a/frontend/src/lib/components/Forms/ModelForm.svelte +++ b/frontend/src/lib/components/Forms/ModelForm.svelte @@ -48,6 +48,7 @@ import FilteringLabelForm from './ModelForm/FilteringLabelForm.svelte'; import OperationalScenarioForm from './ModelForm/OperationalScenarioForm.svelte'; import StrategicScenarioForm from './ModelForm/StrategicScenarioForm.svelte'; + import { goto } from '$lib/utils/breadcrumbs'; export let form: SuperValidated; export let invalidateAll = true; // set to false to keep form data using muliple forms on a page @@ -70,7 +71,7 @@ var currentUrl = window.location.href; var url = new URL(currentUrl); var nextValue = getSecureRedirect(url.searchParams.get('next')); - if (nextValue) window.location.href = nextValue; + if (nextValue) goto(nextValue); } } $: shape = schema.shape || schema._def.schema.shape;