1
0
Fork 0
mirror of synced 2024-07-03 13:30:46 +12:00

fix redirect issues when refreshing page

This commit is contained in:
kevmodrome 2020-04-09 10:55:47 +02:00
parent 4e48fc60a5
commit 5a3de93734
3 changed files with 23 additions and 8 deletions

View file

@ -24,13 +24,6 @@
return state
})
}
onMount(() => {
if ($store.appInstances.length > 0) {
selectDatabase($store.appInstances[0])
$goto(`./database/${$backendUiStore.selectedDatabase.id}`)
}
})
</script>
<div class="root">

View file

@ -44,7 +44,7 @@
</div>
{#if $backendUiStore.selectedDatabase.id}
<ModelDataTable {selectRecord} />
{:else}Please select a database{/if}
{/if}
<style>
.database-actions {

View file

@ -1 +1,23 @@
<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>
Please select a database