fix redirect issues when refreshing page
This commit is contained in:
parent
4e48fc60a5
commit
5a3de93734
|
@ -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">
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
{#if $backendUiStore.selectedDatabase.id}
|
||||
<ModelDataTable {selectRecord} />
|
||||
{:else}Please select a database{/if}
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.database-actions {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue