Add default budibase org details

This commit is contained in:
Andrew Kingston 2021-05-18 13:54:04 +01:00
parent 0f73190b5f
commit e5d1d8c214
1 changed files with 5 additions and 5 deletions

View File

@ -1,15 +1,15 @@
import { writable, get } from "svelte/store" import { writable, get } from "svelte/store"
import api from "builderStore/api" import api from "builderStore/api"
const FALLBACK_CONFIG = { const DEFAULT_CONFIG = {
platformUrl: "", platformUrl: "",
logoUrl: "", logoUrl: "https://i.imgur.com/ZKyklgF.png",
docsUrl: "", docsUrl: "",
company: "http://localhost:10000", company: "Budibase",
} }
export function createOrganisationStore() { export function createOrganisationStore() {
const store = writable({}) const store = writable(DEFAULT_CONFIG)
const { subscribe, set } = store const { subscribe, set } = store
async function init() { async function init() {
@ -17,7 +17,7 @@ export function createOrganisationStore() {
const json = await res.json() const json = await res.json()
if (json.status === 400) { if (json.status === 400) {
set(FALLBACK_CONFIG) set(DEFAULT_CONFIG)
} else { } else {
set({ ...json.config, _rev: json._rev }) set({ ...json.config, _rev: json._rev })
} }