diff --git a/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte b/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte index 07a5db67a..3bc8c9f66 100644 --- a/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte +++ b/src/routes/(console)/organization-[organization]/billing/budgetAlert.svelte @@ -18,7 +18,9 @@ import { addNotification } from '$lib/stores/notifications'; import { currentPlan, organization } from '$lib/stores/organization'; import { sdk } from '$lib/stores/sdk'; - import { onMount } from 'svelte'; + import { onMount, tick } from 'svelte'; + import { page } from '$app/stores'; + import { scrollToUpdateBudget } from '$routes/(console)/organization-[organization]/billing/store'; export let alertsEnabled = false; @@ -78,106 +80,121 @@ $: isButtonDisabled = symmetricDifference(alerts, $organization.budgetAlerts).length === 0 || !alertsEnabled; + + let formHolderElement: HTMLDivElement; + + $: if ($scrollToUpdateBudget) { + history.replaceState(null, '', $page.url.pathname); + + tick().then(() => { + formHolderElement?.scrollIntoView({ + block: 'nearest' + }); + }); + } -