diff --git a/src/components/floweditor/FlowEditor.tsx b/src/components/floweditor/FlowEditor.tsx index 510043ab3..49d566c3d 100644 --- a/src/components/floweditor/FlowEditor.tsx +++ b/src/components/floweditor/FlowEditor.tsx @@ -59,22 +59,24 @@ export const FlowEditor = (props: FlowEditorProps) => { const [getOrganizationServices] = useLazyQuery(GET_ORGANIZATION_SERVICES, { fetchPolicy: 'network-only', - onCompleted: (services) => { - const { dialogflow, googleCloudStorage, flowUuidDisplay, contactProfileEnabled } = - services.organizationServices; + onCompleted: ({ organizationServices }) => { + if (organizationServices) { + const { dialogflow, googleCloudStorage, flowUuidDisplay, contactProfileEnabled } = + organizationServices; - if (googleCloudStorage) { - config.attachmentsEnabled = true; - } - if (!dialogflow) { - config.excludeTypes.push('split_by_intent'); - } - if (flowUuidDisplay) { - config.showNodeLabel = true; - } + if (googleCloudStorage) { + config.attachmentsEnabled = true; + } + if (!dialogflow) { + config.excludeTypes.push('split_by_intent'); + } + if (flowUuidDisplay) { + config.showNodeLabel = true; + } - if (contactProfileEnabled) { - config.filters.push('profile'); + if (contactProfileEnabled) { + config.filters.push('profile'); + } } showFlowEditor(document.getElementById('flow'), config);