diff --git a/packages/builder/src/builderStore/index.js b/packages/builder/src/builderStore/index.js index 23704556ad..5181e756c6 100644 --- a/packages/builder/src/builderStore/index.js +++ b/packages/builder/src/builderStore/index.js @@ -1,6 +1,5 @@ import { getFrontendStore } from "./store/frontend" import { getAutomationStore } from "./store/automation" -import { getHostingStore } from "./store/hosting" import { getThemeStore } from "./store/theme" import { derived, writable } from "svelte/store" import { FrontendTypes, LAYOUT_NAMES } from "../constants" @@ -9,7 +8,6 @@ import { findComponent } from "./componentUtils" export const store = getFrontendStore() export const automationStore = getAutomationStore() export const themeStore = getThemeStore() -export const hostingStore = getHostingStore() export const currentAsset = derived(store, $store => { const type = $store.currentFrontEndType diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index fdfe450edf..0d740e08e0 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -2,7 +2,6 @@ import { get, writable } from "svelte/store" import { cloneDeep } from "lodash/fp" import { allScreens, - hostingStore, currentAsset, mainLayout, selectedComponent, @@ -100,7 +99,6 @@ export const getFrontendStore = () => { version: application.version, revertableVersion: application.revertableVersion, })) - await hostingStore.actions.fetch() // Initialise backend stores const [_integrations] = await Promise.all([ diff --git a/packages/builder/src/builderStore/store/hosting.js b/packages/builder/src/builderStore/store/hosting.js deleted file mode 100644 index fb174c2663..0000000000 --- a/packages/builder/src/builderStore/store/hosting.js +++ /dev/null @@ -1,34 +0,0 @@ -import { writable } from "svelte/store" -import api, { get } from "../api" - -const INITIAL_HOSTING_UI_STATE = { - appUrl: "", - deployedApps: {}, - deployedAppNames: [], - deployedAppUrls: [], -} - -export const getHostingStore = () => { - const store = writable({ ...INITIAL_HOSTING_UI_STATE }) - store.actions = { - fetch: async () => { - const response = await api.get("/api/hosting/urls") - const urls = await response.json() - store.update(state => { - state.appUrl = urls.app - return state - }) - }, - fetchDeployedApps: async () => { - let deployments = await (await get("/api/hosting/apps")).json() - store.update(state => { - state.deployedApps = deployments - state.deployedAppNames = Object.values(deployments).map(app => app.name) - state.deployedAppUrls = Object.values(deployments).map(app => app.url) - return state - }) - return deployments - }, - } - return store -} diff --git a/packages/builder/src/components/deploy/DeploymentHistory.svelte b/packages/builder/src/components/deploy/DeploymentHistory.svelte index f6bbcef4d4..36c2433c27 100644 --- a/packages/builder/src/components/deploy/DeploymentHistory.svelte +++ b/packages/builder/src/components/deploy/DeploymentHistory.svelte @@ -6,7 +6,7 @@ import api from "builderStore/api" import { notifications } from "@budibase/bbui" import CreateWebhookDeploymentModal from "./CreateWebhookDeploymentModal.svelte" - import { store, hostingStore } from "builderStore" + import { store } from "builderStore" const DeploymentStatus = { SUCCESS: "SUCCESS", @@ -37,7 +37,7 @@ let poll let deployments = [] let urlComponent = $store.url || `/${appId}` - let deploymentUrl = `${$hostingStore.appUrl}${urlComponent}` + let deploymentUrl = `${urlComponent}` const formatDate = (date, format) => Intl.DateTimeFormat("en-GB", DATE_OPTIONS[format]).format(date) diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte index dccf8017aa..3efd0231aa 100644 --- a/packages/builder/src/components/start/CreateAppModal.svelte +++ b/packages/builder/src/components/start/CreateAppModal.svelte @@ -1,9 +1,8 @@