From 5662fac440dfb0072d31f6a4e965684a3872be64 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Wed, 28 Nov 2018 18:37:39 +0530 Subject: [PATCH] Refactor redirection on campaign creation --- frontend/my/src/Campaign.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/my/src/Campaign.js b/frontend/my/src/Campaign.js index fb4d408..baaa8b3 100644 --- a/frontend/my/src/Campaign.js +++ b/frontend/my/src/Campaign.js @@ -229,7 +229,10 @@ class TheFormDef extends React.PureComponent { message: "Campaign created", description: `"${values["name"]}" created` }) - this.props.route.history.push(cs.Routes.ViewCampaign.replace(":id", resp.data.data.id) + "#content") + this.props.route.history.push({ + pathname: cs.Routes.ViewCampaign.replace(":id", resp.data.data.id), + hash: "content-tab" + }) cb(true) }).catch(e => { notification["error"]({ placement: cs.MsgPosition, message: "Error", description: e.message }) @@ -435,7 +438,7 @@ class Campaign extends React.PureComponent { } // Content tab? - if(document.location.hash === "#content") { + if(document.location.hash === "#content-tab") { this.setCurrentTab("content") } }