1
0
Fork 0
mirror of synced 2024-10-02 10:08:09 +13:00

Add default budibase org details

This commit is contained in:
Andrew Kingston 2021-05-18 13:54:04 +01:00
parent 4f0f532b72
commit 6a418ecd51

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 })
} }