From fd8400bee58fd23d8b6796d4d48356b32cf4b9b4 Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 23 Jun 2023 11:56:59 +0100 Subject: [PATCH] PR feedback and removed some comments --- packages/builder/src/stores/portal/licensing.js | 3 --- packages/client/src/components/ClientApp.svelte | 5 ++--- packages/client/src/index.js | 4 +++- packages/server/src/api/controllers/static/index.ts | 5 ++--- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/builder/src/stores/portal/licensing.js b/packages/builder/src/stores/portal/licensing.js index e94e7d2e21..4a59f29f52 100644 --- a/packages/builder/src/stores/portal/licensing.js +++ b/packages/builder/src/stores/portal/licensing.js @@ -76,12 +76,9 @@ export const createLicensingStore = () => { await actions.setQuotaUsage() }, setNavigation: () => { - //"/builder/portal/account/upgrade" const adminStore = get(admin) const authStore = get(auth) - //Add cloud check here too??? - const upgradeUrl = authStore?.user?.accountPortalAccess ? `${adminStore.accountPortalUrl}/portal/upgrade` : "/builder/portal/account/upgrade" diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 8c6c20f258..06c4681b95 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -90,8 +90,7 @@ builderStore.actions.notifyLoaded() } else { builderStore.actions.analyticsPing({ - source: "app", - ...{ embedded: $appStore.embedded || undefined }, + embedded: !!$appStore.embedded, }) } }) @@ -169,7 +168,7 @@ {@html ErrorSVG} - Your application could not be loaded + This Budibase app is not publicly accessible diff --git a/packages/client/src/index.js b/packages/client/src/index.js index a95ec24746..1550ba4d7b 100644 --- a/packages/client/src/index.js +++ b/packages/client/src/index.js @@ -46,7 +46,9 @@ const loadBudibase = async () => { appStore.actions.setAppId(window["##BUDIBASE_APP_ID##"]) // Set the flag used to determine if the app is being loaded via an iframe - appStore.actions.setAppEmbedded(window["##BUDIBASE_APP_EMBEDDED##"] == "true") + appStore.actions.setAppEmbedded( + window["##BUDIBASE_APP_EMBEDDED##"] === "true" + ) // Fetch environment info if (!get(environmentStore)?.loaded) { diff --git a/packages/server/src/api/controllers/static/index.ts b/packages/server/src/api/controllers/static/index.ts index fe3f653051..fc17cd46e0 100644 --- a/packages/server/src/api/controllers/static/index.ts +++ b/packages/server/src/api/controllers/static/index.ts @@ -100,9 +100,8 @@ export const deleteObjects = async function (ctx: any) { } export const serveApp = async function (ctx: any) { - const bbHeaderEmbed = ctx.request.get("x-budibase-embed") - ? ctx.get("x-budibase-embed").toLowerCase() == "true" - : false + const bbHeaderEmbed = + ctx.request.get("x-budibase-embed")?.toLowerCase() === "true" //Public Settings const { config } = await configs.getSettingsConfigDoc()