From 8edee76f8b78a878833c1187926e10fa37bfa4a3 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 10 Mar 2017 11:38:27 +0100 Subject: [PATCH] Pull steps from actual available steps (#4848) --- js/src/modals/DeployContract/deployContract.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/js/src/modals/DeployContract/deployContract.js b/js/src/modals/DeployContract/deployContract.js index 14930d312ba..802de64fb50 100644 --- a/js/src/modals/DeployContract/deployContract.js +++ b/js/src/modals/DeployContract/deployContract.js @@ -142,12 +142,13 @@ class DeployContract extends Component { render () { const { step, deployError, rejected, inputs } = this.state; - const realStep = Object.keys(STEPS).findIndex((k) => k === step); - const realSteps = deployError || rejected - ? null - : Object.keys(STEPS) - .filter((k) => k !== 'CONTRACT_PARAMETERS' || inputs.length > 0) - .map((k) => STEPS[k]); + const realStepKeys = deployError || rejected + ? [] + : Object.keys(STEPS).filter((k) => k !== 'CONTRACT_PARAMETERS' || inputs.length > 0); + const realStep = realStepKeys.findIndex((k) => k === step); + const realSteps = realStepKeys.length + ? realStepKeys.map((k) => STEPS[k]) + : null; const title = realSteps ? null