diff --git a/packages/web/src/components/EditorLayout/index.jsx b/packages/web/src/components/EditorLayout/index.jsx index 75cf0cb1..37819435 100644 --- a/packages/web/src/components/EditorLayout/index.jsx +++ b/packages/web/src/components/EditorLayout/index.jsx @@ -59,23 +59,25 @@ export default function EditorLayout() { const onFlowStatusUpdate = React.useCallback( async (active) => { - await updateFlowStatus({ - variables: { - input: { - id: flowId, - active, + try { + await updateFlowStatus({ + variables: { + input: { + id: flowId, + active, + }, }, - }, - optimisticResponse: { - updateFlowStatus: { - __typename: 'Flow', - id: flowId, - active, + optimisticResponse: { + updateFlowStatus: { + __typename: 'Flow', + id: flowId, + active, + }, }, - }, - }); + }); - await queryClient.invalidateQueries({ queryKey: ['flows', flowId] }); + await queryClient.invalidateQueries({ queryKey: ['flows', flowId] }); + } catch (err) {} }, [flowId, queryClient], );