Tidy up by using optional chaining

This commit is contained in:
Andrew Kingston 2020-09-17 14:19:14 +01:00
parent 26c952b9a2
commit aec7cb9cc6
2 changed files with 3 additions and 6 deletions

View File

@ -4,9 +4,8 @@
import { notifier } from "builderStore/store/notifications"
import Flowchart from "./flowchart/FlowChart.svelte"
$: workflow =
$workflowStore.selectedWorkflow && $workflowStore.selectedWorkflow.workflow
$: workflowLive = workflow && workflow.live
$: workflow = $workflowStore.selectedWorkflow?.workflow
$: workflowLive = workflow?.live
$: instanceId = $backendUiStore.selectedDatabase._id
function onSelect(block) {

View File

@ -8,9 +8,7 @@
const { open, close } = getContext("simple-modal")
$: selectedWorkflowId =
$workflowStore.selectedWorkflow &&
$workflowStore.selectedWorkflow.workflow._id
$: selectedWorkflowId = $workflowStore.selectedWorkflow?.workflow?._id
function newWorkflow() {
open(