diff --git a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js index 2a3c5c98d..ceaccc5f5 100644 --- a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js +++ b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js @@ -72,16 +72,32 @@ class BanksIndex extends Component{ constructor(props){ super(props); this.state={ - crumbData:undefined + crumbData:undefined, + publicly:undefined } } + componentDidMount = () =>{ + let pathname = this.props.location.pathname; + this.setState({ + publicly:pathname.indexOf("/publicly") > -1 + }) + } + initPublic = (crumbData) =>{ this.setState({ crumbData }) } + componentDidUpdate=()=>{ + let { publicly }=this.state + + if(this.props.current_user && this.props.current_user.professional_certification == false && publicly){ + this.props.history.push(`/topicbank/${this.props.current_user.login}/publicly`); + } + } + render(){ let { crumbData }=this.state const common = {