Skip to content

Commit

Permalink
Use goto wrapper for cancel buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Dec 20, 2024
1 parent 00d3009 commit 88db7d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/lib/components/Forms/ModelForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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<AnyZodObject>;
export let invalidateAll = true; // set to false to keep form data using muliple forms on a page
Expand All @@ -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;
Expand Down

0 comments on commit 88db7d0

Please sign in to comment.