From fc49f511e67305244c9deed907703ca0826e211d Mon Sep 17 00:00:00 2001 From: Cheton Wu Date: Wed, 4 Oct 2017 10:34:12 +0800 Subject: [PATCH] Workflow state and context enhancements --- src/widgets/ReactApp/App.jsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/widgets/ReactApp/App.jsx b/src/widgets/ReactApp/App.jsx index 12e75f5..9e795df 100644 --- a/src/widgets/ReactApp/App.jsx +++ b/src/widgets/ReactApp/App.jsx @@ -89,10 +89,13 @@ class App extends PureComponent { const initialState = this.getInitialState(); this.setState({ ...initialState }); }, - 'workflow:state': (workflowState) => { - if (this.state.workflowState !== workflowState) { - this.setState({ workflowState: workflowState }); - } + 'workflow:state': (state, context) => { + this.setState({ + workflow: { + state: state, + context: context + } + }); }, 'controller:state': (controllerType, controllerState) => { this.setState(state => ({ @@ -220,7 +223,10 @@ class App extends PureComponent { type: controller.type, state: controller.state }, - workflowState: controller.workflowState, + workflow: { + state: controller.workflow.state, + context: controller.workflow.context + }, machinePosition: { // Machine position x: '0.000', y: '0.000',