Skip to content

Commit

Permalink
added loading
Browse files Browse the repository at this point in the history
  • Loading branch information
mohdshamoon committed May 31, 2021
1 parent dd94f92 commit 05785a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/floweditor/FlowEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { PUBLISH_FLOW } from '../../graphql/mutations/Flow';
import { GET_FLOW_DETAILS } from '../../graphql/queries/Flow';
import { setAuthHeaders } from '../../services/AuthService';
import { GET_ORGANIZATION_SERVICES } from '../../graphql/queries/Organization';
import { Loading } from '../UI/Layout/Loading/Loading';

declare function showFlowEditor(node: any, config: any): void;

Expand Down Expand Up @@ -155,6 +156,7 @@ export const FlowEditor = (props: FlowEditorProps) => {
const { uuid } = match.params;
const [publishDialog, setPublishDialog] = useState(false);
const [simulatorId, setSimulatorId] = useState(0);
const [loading, setLoading] = useState(true);

const config = setConfig(uuid);
const [published, setPublished] = useState(false);
Expand All @@ -179,6 +181,7 @@ export const FlowEditor = (props: FlowEditorProps) => {
config.excludeTypes.push('split_by_intent');
}
showFlowEditor(document.getElementById('flow'), config);
setLoading(false);
},
});

Expand Down Expand Up @@ -428,6 +431,7 @@ export const FlowEditor = (props: FlowEditorProps) => {
) : null}
</div>
<div id="flow" />
{loading && <Loading />}
</div>
</>
);
Expand Down

0 comments on commit 05785a2

Please sign in to comment.