From 539250899c14479cdb991545a1054f3d1835504d Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 21 Jun 2021 19:47:40 +0100 Subject: [PATCH 1/2] prevent portal link from navigating in builder preview --- packages/standard-components/src/Layout.svelte | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/standard-components/src/Layout.svelte b/packages/standard-components/src/Layout.svelte index 1e26f23a3c..44b009850c 100644 --- a/packages/standard-components/src/Layout.svelte +++ b/packages/standard-components/src/Layout.svelte @@ -2,7 +2,7 @@ import { getContext } from "svelte" import { Heading, Icon } from "@budibase/bbui" - const { styleable, linkable } = getContext("sdk") + const { styleable, linkable, builderStore } = getContext("sdk") const component = getContext("component") export let title @@ -41,6 +41,11 @@ const close = () => { mobileOpen = false } + + const navigateToPortal = () => { + if ($builderStore.inBuilder) return + window.location.href = "/builder/apps" + }
@@ -72,7 +77,7 @@ (window.location.href = "/builder/apps")} + on:click={navigateToPortal} />
From 1a83a8916b031f9e713655cb19bbb310d1ef5d29 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 21 Jun 2021 22:43:15 +0100 Subject: [PATCH 2/2] lint --- packages/standard-components/src/Layout.svelte | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/standard-components/src/Layout.svelte b/packages/standard-components/src/Layout.svelte index 44b009850c..1e4c083f4c 100644 --- a/packages/standard-components/src/Layout.svelte +++ b/packages/standard-components/src/Layout.svelte @@ -74,11 +74,7 @@ {/if}
- +