1
0
Fork 0
mirror of synced 2024-10-06 04:54:52 +13:00

Don't show budibase logo on free plan in self hosted installations

This commit is contained in:
Rory Powell 2022-09-15 13:22:17 +01:00
parent a691f4035f
commit 00cef3a047
5 changed files with 45 additions and 2 deletions

View file

@ -9,7 +9,14 @@
import licensing from "../../licensing" import licensing from "../../licensing"
const sdk = getContext("sdk") const sdk = getContext("sdk")
const { routeStore, styleable, linkable, builderStore, currentRole } = sdk const {
routeStore,
styleable,
linkable,
builderStore,
currentRole,
environmentStore,
} = sdk
const component = getContext("component") const component = getContext("component")
const context = getContext("context") const context = getContext("context")
@ -228,7 +235,7 @@
</div> </div>
{/if} {/if}
{#if !$builderStore.inBuilder && licensing.logoEnabled()} {#if !$builderStore.inBuilder && licensing.logoEnabled() && $environmentStore.cloud}
<MadeInBudibase /> <MadeInBudibase />
{/if} {/if}

View file

@ -9,6 +9,7 @@ import {
rowSelectionStore, rowSelectionStore,
componentStore, componentStore,
currentRole, currentRole,
environmentStore,
} from "stores" } from "stores"
import { styleable } from "utils/styleable" import { styleable } from "utils/styleable"
import { linkable } from "utils/linkable" import { linkable } from "utils/linkable"
@ -27,6 +28,7 @@ export default {
builderStore, builderStore,
uploadStore, uploadStore,
componentStore, componentStore,
environmentStore,
currentRole, currentRole,
styleable, styleable,
linkable, linkable,

View file

@ -0,0 +1,31 @@
import { API } from "api"
import { writable } from "svelte/store"
const initialState = {
cloud: false,
}
const createEnvironmentStore = () => {
const store = writable(initialState)
const actions = {
fetchEnvironment: async () => {
try {
const environment = await API.getEnvironment()
store.set({
...initialState,
...environment,
})
} catch (error) {
store.set(initialState)
}
},
}
return {
subscribe: store.subscribe,
actions,
}
}
export const environmentStore = createEnvironmentStore()

View file

@ -17,6 +17,7 @@ export { devToolsStore } from "./devTools"
export { componentStore } from "./components" export { componentStore } from "./components"
export { uploadStore } from "./uploads.js" export { uploadStore } from "./uploads.js"
export { rowSelectionStore } from "./rowSelection.js" export { rowSelectionStore } from "./rowSelection.js"
export { environmentStore } from "./environment"
// Context stores are layered and duplicated, so it is not a singleton // Context stores are layered and duplicated, so it is not a singleton
export { createContextStore } from "./context" export { createContextStore } from "./context"

View file

@ -1,7 +1,9 @@
import { routeStore } from "./routes" import { routeStore } from "./routes"
import { appStore } from "./app" import { appStore } from "./app"
import { environmentStore } from "./environment"
export async function initialise() { export async function initialise() {
await routeStore.actions.fetchRoutes() await routeStore.actions.fetchRoutes()
await appStore.actions.fetchAppDefinition() await appStore.actions.fetchAppDefinition()
await environmentStore.actions.fetchEnvironment()
} }