Skip to content

Commit

Permalink
Merge pull request #2082 from glific/hotfix/organization-services
Browse files Browse the repository at this point in the history
Added null check for organization services
  • Loading branch information
mdshamoon authored Jul 15, 2022
2 parents 82f284e + b63a402 commit ee361fe
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/components/floweditor/FlowEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ee361fe

Please sign in to comment.