From aec7cb9cc6e28242683fb875f0c586c4b95075f1 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 17 Sep 2020 14:19:14 +0100 Subject: [PATCH] Tidy up by using optional chaining --- .../workflow/WorkflowBuilder/WorkflowBuilder.svelte | 5 ++--- .../workflow/WorkflowPanel/WorkflowList/WorkflowList.svelte | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/components/workflow/WorkflowBuilder/WorkflowBuilder.svelte b/packages/builder/src/components/workflow/WorkflowBuilder/WorkflowBuilder.svelte index b6dabc55fd..c5f940655e 100644 --- a/packages/builder/src/components/workflow/WorkflowBuilder/WorkflowBuilder.svelte +++ b/packages/builder/src/components/workflow/WorkflowBuilder/WorkflowBuilder.svelte @@ -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) { diff --git a/packages/builder/src/components/workflow/WorkflowPanel/WorkflowList/WorkflowList.svelte b/packages/builder/src/components/workflow/WorkflowPanel/WorkflowList/WorkflowList.svelte index c5276227bc..40dc16181b 100644 --- a/packages/builder/src/components/workflow/WorkflowPanel/WorkflowList/WorkflowList.svelte +++ b/packages/builder/src/components/workflow/WorkflowPanel/WorkflowList/WorkflowList.svelte @@ -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(