Merge pull request #10406 from Budibase/fix/budi-6920
Fix automation history first load in multi-tenant environments
This commit is contained in:
commit
e37b377036
|
@ -10,7 +10,10 @@ import { auth } from "./stores/portal"
|
||||||
export const API = createAPIClient({
|
export const API = createAPIClient({
|
||||||
attachHeaders: headers => {
|
attachHeaders: headers => {
|
||||||
// Attach app ID header from store
|
// Attach app ID header from store
|
||||||
headers["x-budibase-app-id"] = get(store).appId
|
let appId = get(store).appId
|
||||||
|
if (appId) {
|
||||||
|
headers["x-budibase-app-id"] = appId
|
||||||
|
}
|
||||||
|
|
||||||
// Add csrf token if authenticated
|
// Add csrf token if authenticated
|
||||||
const user = get(auth).user
|
const user = get(auth).user
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
import * as routify from "@roxi/routify"
|
import * as routify from "@roxi/routify"
|
||||||
import { onDestroy } from "svelte"
|
import { onDestroy } from "svelte"
|
||||||
|
|
||||||
// Keep URL and state in sync for selected screen ID
|
// Keep URL and state in sync for selected app ID
|
||||||
const stopSyncing = syncURLToState({
|
const stopSyncing = syncURLToState({
|
||||||
urlParam: "appId",
|
urlParam: "appId",
|
||||||
stateKey: "selectedAppId",
|
stateKey: "selectedAppId",
|
||||||
|
@ -47,6 +47,7 @@
|
||||||
let deletionModal
|
let deletionModal
|
||||||
let exportPublishedVersion = false
|
let exportPublishedVersion = false
|
||||||
let deletionConfirmationAppName
|
let deletionConfirmationAppName
|
||||||
|
let loaded = false
|
||||||
|
|
||||||
$: app = $overview.selectedApp
|
$: app = $overview.selectedApp
|
||||||
$: appId = $overview.selectedAppId
|
$: appId = $overview.selectedAppId
|
||||||
|
@ -56,10 +57,12 @@
|
||||||
$: lockedByYou = $auth.user.email === app?.lockedBy?.email
|
$: lockedByYou = $auth.user.email === app?.lockedBy?.email
|
||||||
|
|
||||||
const initialiseApp = async appId => {
|
const initialiseApp = async appId => {
|
||||||
|
loaded = false
|
||||||
try {
|
try {
|
||||||
const pkg = await API.fetchAppPackage(appId)
|
const pkg = await API.fetchAppPackage(appId)
|
||||||
await store.actions.initialise(pkg)
|
await store.actions.initialise(pkg)
|
||||||
await API.syncApp(appId)
|
await API.syncApp(appId)
|
||||||
|
loaded = true
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notifications.error("Error initialising app overview")
|
notifications.error("Error initialising app overview")
|
||||||
$goto("../../")
|
$goto("../../")
|
||||||
|
@ -228,7 +231,9 @@
|
||||||
active={$isActive("./version")}
|
active={$isActive("./version")}
|
||||||
/>
|
/>
|
||||||
</SideNav>
|
</SideNav>
|
||||||
|
{#if loaded}
|
||||||
<slot />
|
<slot />
|
||||||
|
{/if}
|
||||||
</Content>
|
</Content>
|
||||||
</Layout>
|
</Layout>
|
||||||
</Page>
|
</Page>
|
||||||
|
|
Loading…
Reference in New Issue