Fix real root issue
This commit is contained in:
parent
22d81fd858
commit
123c47c4d1
|
@ -5,12 +5,12 @@ import {
|
|||
} from "@budibase/frontend-core"
|
||||
import { store } from "./builderStore"
|
||||
import { get } from "svelte/store"
|
||||
import { auth, overview } from "./stores/portal"
|
||||
import { auth } from "./stores/portal"
|
||||
|
||||
export const API = createAPIClient({
|
||||
attachHeaders: headers => {
|
||||
// Attach app ID header from store
|
||||
let appId = get(store).appId || get(overview).selectedAppId
|
||||
let appId = get(store).appId
|
||||
if (appId) {
|
||||
headers["x-budibase-app-id"] = appId
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
let deletionModal
|
||||
let exportPublishedVersion = false
|
||||
let deletionConfirmationAppName
|
||||
let loaded = false
|
||||
|
||||
$: app = $overview.selectedApp
|
||||
$: appId = $overview.selectedAppId
|
||||
|
@ -56,10 +57,12 @@
|
|||
$: lockedByYou = $auth.user.email === app?.lockedBy?.email
|
||||
|
||||
const initialiseApp = async appId => {
|
||||
loaded = false
|
||||
try {
|
||||
const pkg = await API.fetchAppPackage(appId)
|
||||
await store.actions.initialise(pkg)
|
||||
await API.syncApp(appId)
|
||||
loaded = true
|
||||
} catch (error) {
|
||||
notifications.error("Error initialising app overview")
|
||||
$goto("../../")
|
||||
|
@ -111,10 +114,6 @@
|
|||
onDestroy(() => {
|
||||
stopSyncing()
|
||||
store.actions.reset()
|
||||
overview.update(state => ({
|
||||
...state,
|
||||
selectedAppId: null,
|
||||
}))
|
||||
})
|
||||
</script>
|
||||
|
||||
|
@ -232,7 +231,9 @@
|
|||
active={$isActive("./version")}
|
||||
/>
|
||||
</SideNav>
|
||||
<slot />
|
||||
{#if loaded}
|
||||
<slot />
|
||||
{/if}
|
||||
</Content>
|
||||
</Layout>
|
||||
</Page>
|
||||
|
|
Loading…
Reference in New Issue