fix small bug where database was not shown on refresh
This commit is contained in:
parent
5a3de93734
commit
99bdf3fea5
|
@ -1,3 +1,25 @@
|
||||||
|
<script>
|
||||||
|
import { store, backendUiStore } from "builderStore"
|
||||||
|
import { goto } from "@sveltech/routify"
|
||||||
|
import { onMount } from "svelte"
|
||||||
|
|
||||||
|
$: instances = $store.appInstances
|
||||||
|
$: views = $store.hierarchy.indexes
|
||||||
|
|
||||||
|
async function selectDatabase(database) {
|
||||||
|
backendUiStore.actions.records.select(null)
|
||||||
|
backendUiStore.actions.views.select(views[0])
|
||||||
|
backendUiStore.actions.database.select(database)
|
||||||
|
}
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
if ($store.appInstances.length > 0) {
|
||||||
|
await selectDatabase($store.appInstances[0])
|
||||||
|
$goto(`./${$backendUiStore.selectedDatabase.id}`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
<div class="root">
|
<div class="root">
|
||||||
<div class="node-view">
|
<div class="node-view">
|
||||||
<slot />
|
<slot />
|
||||||
|
|
Loading…
Reference in New Issue