adds working automation routing

This commit is contained in:
Keviin Åberg Kultalahti 2021-03-15 15:23:22 +01:00
parent 2900704a4c
commit 230f871e83
2 changed files with 13 additions and 38 deletions

View File

@ -1,22 +1,6 @@
<script> <script>
import { onMount } from 'svelte' import AutomationBuilder from "components/automation/AutomationBuilder/AutomationBuilder.svelte"
import { automationStore } from "builderStore" </script>
import AutomationBuilder from "components/automation/AutomationBuilder/AutomationBuilder.svelte"
onMount(async () => { <AutomationBuilder />
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 />

View File

@ -1,22 +1,20 @@
<script> <script>
import { goto, leftover } from "@sveltech/routify"
import { onMount } from 'svelte' import { onMount } from 'svelte'
import { automationStore } from "builderStore" import { automationStore } from "builderStore"
$: automationCount = $automationStore.automations?.length ?? 0 $: automationCount = $automationStore.automations?.length ?? 0
onMount(async () => { onMount(async () => {
console.log('Automation Store: ', $automationStore) // navigate to first automation in list, if not already selected
console.log('Automation Store Methods: ', automationStore) if (
// navigate to first automation in list, if not already selected !$leftover &&
// if ( $automationStore.automations.length > 0 &&
// !$leftover && (!$automationStore.selectedAutomation || !$automationStore.selectedAutomation?.automation?._id)
// $backendUiStore.tables.length > 0 && ) {
// (!$backendUiStore.selectedTable || !$backendUiStore.selectedTable._id) $goto(`../${$automationStore.automations[0]._id}`)
// ) { }
// // this file routes as .../tables/index, so, go up one. })
// $goto(`../${$backendUiStore.tables[0]._id}`)
// }
})
</script> </script>
@ -24,10 +22,3 @@
<i>Create your first automation to get started</i> <i>Create your first automation to get started</i>
{:else}<i>Select an automation to edit</i>{/if} {: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>