From 74821a4d4c36094d81204d8a088f7315e3efab67 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 1 May 2018 18:14:07 +0200 Subject: [PATCH] Readd save dialog on section change --- .../src/routes/Configure/containers/Configure.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/coral-admin/src/routes/Configure/containers/Configure.js b/client/coral-admin/src/routes/Configure/containers/Configure.js index c4b8bc0ca..3d2789974 100644 --- a/client/coral-admin/src/routes/Configure/containers/Configure.js +++ b/client/coral-admin/src/routes/Configure/containers/Configure.js @@ -49,7 +49,13 @@ class ConfigureContainer extends React.Component { handleSectionChange = async section => { const nextRoute = `/admin/configure/${section}`; - this.props.router.push(nextRoute); + if (this.hasPendingData()) { + this.nextRoute = nextRoute; + this.props.showSaveDialog(); + } else { + // Just go to the section + this.props.router.push(nextRoute); + } }; navigationPrompt = e => {