From 8a734a2613e44c8535030d622d56353cdebd4390 Mon Sep 17 00:00:00 2001 From: Matthew Shao Date: Mon, 13 Mar 2017 19:34:25 +0800 Subject: [PATCH] [web] Fixes the flaw in #2133 --- web/src/js/ducks/ui/flow.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/js/ducks/ui/flow.js b/web/src/js/ducks/ui/flow.js index 8cb6e1700..ba604ea2f 100644 --- a/web/src/js/ducks/ui/flow.js +++ b/web/src/js/ducks/ui/flow.js @@ -60,7 +60,7 @@ export default function reducer(state = defaultState, action) { // There is no explicit "stop edit" event. // We stop editing when we receive an update for // the currently edited flow from the server - if (action.flow.id === state.modifiedFlow.id) { + if (action.data.id === state.modifiedFlow.id) { return { ...state, modifiedFlow: false, @@ -148,7 +148,7 @@ export function setContent(content){ return { type: SET_CONTENT, content } } -export function stopEdit(flow, modifiedFlow) { - let diff = getDiff(flow, modifiedFlow) - return {type: flowsActions.UPDATE, flow, diff } +export function stopEdit(data, modifiedFlow) { + let diff = getDiff(data, modifiedFlow) + return {type: flowsActions.UPDATE, data, diff } }