From 1a21e16710fb2c4170abc4ef6d4472848737d7c0 Mon Sep 17 00:00:00 2001 From: Ivar Date: Wed, 16 Nov 2016 21:58:30 +0100 Subject: [PATCH] Clear input store when user cancel. Closes #4 --- frontend/src/component/feature/form-add-container.jsx | 1 + frontend/src/component/feature/form-edit-container.jsx | 1 + frontend/src/component/strategies/add-container.js | 1 + 3 files changed, 3 insertions(+) diff --git a/frontend/src/component/feature/form-add-container.jsx b/frontend/src/component/feature/form-add-container.jsx index 0b06529079..fa7f567c8b 100644 --- a/frontend/src/component/feature/form-add-container.jsx +++ b/frontend/src/component/feature/form-add-container.jsx @@ -18,6 +18,7 @@ const prepare = (methods, dispatch) => { methods.onCancel = (evt) => { evt.preventDefault(); + methods.clear(); hashHistory.push('/features'); }; diff --git a/frontend/src/component/feature/form-edit-container.jsx b/frontend/src/component/feature/form-edit-container.jsx index e88aa4341d..44a7b62fce 100644 --- a/frontend/src/component/feature/form-edit-container.jsx +++ b/frontend/src/component/feature/form-edit-container.jsx @@ -33,6 +33,7 @@ const prepare = (methods, dispatch) => { methods.onCancel = (evt) => { evt.preventDefault(); + methods.clear(); hashHistory.push('/features'); }; diff --git a/frontend/src/component/strategies/add-container.js b/frontend/src/component/strategies/add-container.js index b9228ff1cf..1ff835c1b8 100644 --- a/frontend/src/component/strategies/add-container.js +++ b/frontend/src/component/strategies/add-container.js @@ -29,6 +29,7 @@ const prepare = (methods, dispatch) => { methods.onCancel = (e) => { e.preventDefault(); + methods.clear(); // somewhat quickfix / hacky to go back.. window.history.back(); };