Update the topnav history when navigating to the automation sections on create

This commit is contained in:
Dean 2024-07-05 14:33:09 +01:00
parent c4055fabb8
commit 9518680d12
1 changed files with 8 additions and 4 deletions

View File

@ -7,9 +7,9 @@
notifications, notifications,
} from "@budibase/bbui" } from "@budibase/bbui"
import { getContext } from "svelte" import { getContext } from "svelte"
import { automationStore, tables } from "stores/builder" import { automationStore, tables, builderStore } from "stores/builder"
import { TriggerStepID } from "constants/backend/automations" import { TriggerStepID } from "constants/backend/automations"
import { goto } from "@roxi/routify" import { goto, layout, isActive } from "@roxi/routify"
const { datasource } = getContext("grid") const { datasource } = getContext("grid")
@ -46,10 +46,14 @@
automationName, automationName,
triggerBlock triggerBlock
) )
builderStore.setPreviousTopNavPath(
"/builder/app/:application/data",
window.location.pathname
)
$goto(`/builder/app/${response.appId}/automation/${response.id}`) $goto(`/builder/app/${response.appId}/automation/${response.id}`)
notifications.success(`Automation created`) notifications.success(`Automation created`)
} catch { } catch (e) {
console.error("Error creating automation", e)
notifications.error("Error creating automation") notifications.error("Error creating automation")
} }
} }