From 9518680d1277f1b5cbf9733dd63a5c6102bd9311 Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 5 Jul 2024 14:33:09 +0100 Subject: [PATCH] Update the topnav history when navigating to the automation sections on create --- .../buttons/grid/GridCreateAutomationButton.svelte | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/buttons/grid/GridCreateAutomationButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/grid/GridCreateAutomationButton.svelte index 3ee1edc4b6..94ac41fd24 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/grid/GridCreateAutomationButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/grid/GridCreateAutomationButton.svelte @@ -7,9 +7,9 @@ notifications, } from "@budibase/bbui" import { getContext } from "svelte" - import { automationStore, tables } from "stores/builder" + import { automationStore, tables, builderStore } from "stores/builder" import { TriggerStepID } from "constants/backend/automations" - import { goto } from "@roxi/routify" + import { goto, layout, isActive } from "@roxi/routify" const { datasource } = getContext("grid") @@ -46,10 +46,14 @@ automationName, triggerBlock ) - + builderStore.setPreviousTopNavPath( + "/builder/app/:application/data", + window.location.pathname + ) $goto(`/builder/app/${response.appId}/automation/${response.id}`) notifications.success(`Automation created`) - } catch { + } catch (e) { + console.error("Error creating automation", e) notifications.error("Error creating automation") } }