adds working automation routing
This commit is contained in:
parent
2900704a4c
commit
230f871e83
|
@ -1,22 +1,6 @@
|
|||
<script>
|
||||
import { onMount } from 'svelte'
|
||||
import { automationStore } from "builderStore"
|
||||
import AutomationBuilder from "components/automation/AutomationBuilder/AutomationBuilder.svelte"
|
||||
</script>
|
||||
|
||||
onMount(async () => {
|
||||
console.log('Automation Store: ', $automationStore)
|
||||
console.log('Automation Store Methods: ', automationStore)
|
||||
// navigate to first automation in list, if not already selected
|
||||
// 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>
|
||||
|
||||
<AutomationBuilder />
|
||||
<AutomationBuilder />
|
||||
|
|
@ -1,21 +1,19 @@
|
|||
<script>
|
||||
import { goto, leftover } from "@sveltech/routify"
|
||||
import { onMount } from 'svelte'
|
||||
import { automationStore } from "builderStore"
|
||||
|
||||
$: automationCount = $automationStore.automations?.length ?? 0
|
||||
|
||||
onMount(async () => {
|
||||
console.log('Automation Store: ', $automationStore)
|
||||
console.log('Automation Store Methods: ', automationStore)
|
||||
// navigate to first automation in list, if not already selected
|
||||
// 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}`)
|
||||
// }
|
||||
if (
|
||||
!$leftover &&
|
||||
$automationStore.automations.length > 0 &&
|
||||
(!$automationStore.selectedAutomation || !$automationStore.selectedAutomation?.automation?._id)
|
||||
) {
|
||||
$goto(`../${$automationStore.automations[0]._id}`)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
@ -24,10 +22,3 @@
|
|||
<i>Create your first automation to get started</i>
|
||||
{:else}<i>Select an automation to edit</i>{/if}
|
||||
|
||||
<style>
|
||||
i {
|
||||
font-size: var(--font-size-m);
|
||||
color: var(--grey-5);
|
||||
margin-top: 2px;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue