removes some logic and fixes table/integration select when switching tabs
This commit is contained in:
parent
6a1ce67e60
commit
fdc1e44896
|
@ -1,18 +1,11 @@
|
||||||
<script>
|
<script>
|
||||||
import { backendUiStore } from "builderStore"
|
import { backendUiStore } from "builderStore"
|
||||||
import { goto, leftover } from "@sveltech/routify"
|
import { goto } from "@sveltech/routify"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
// navigate to first table in list, if not already selected
|
// navigate to first table in list, if not already selected
|
||||||
// and this is the final url (i.e. no selectedTable)
|
$backendUiStore.datasources.length > 0 && $goto(`../${$backendUiStore.datasources[0]._id}`)
|
||||||
if (
|
|
||||||
!$leftover &&
|
|
||||||
$backendUiStore.datasources.length > 0 && !$backendUiStore.selectedDatasourceId
|
|
||||||
) {
|
|
||||||
// this file routes as .../tables/index, so, go up one.
|
|
||||||
$goto(`../${$backendUiStore.datasources[0]._id}`)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,10 @@
|
||||||
<script>
|
<script>
|
||||||
import { backendUiStore } from "builderStore"
|
import { backendUiStore } from "builderStore"
|
||||||
import { goto, leftover } from "@sveltech/routify"
|
import { goto } from "@sveltech/routify"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
// navigate to first table in list, if not already selected
|
$backendUiStore.tables.length > 0 && $goto(`../${$backendUiStore.tables[0]._id}`)
|
||||||
// and this is the final url (i.e. no selectedTable)
|
|
||||||
if (
|
|
||||||
!$leftover &&
|
|
||||||
$backendUiStore.tables.length > 0 &&
|
|
||||||
(!$backendUiStore.selectedTable || !$backendUiStore.selectedTable._id)
|
|
||||||
) {
|
|
||||||
// this file routes as .../tables/index, so, go up one.
|
|
||||||
$goto(`../${$backendUiStore.tables[0]._id}`)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue