|
|
|
@ -78,10 +78,10 @@ class BanksIndex extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount = () =>{
|
|
|
|
|
let pathname = this.props.location.pathname;
|
|
|
|
|
this.setState({
|
|
|
|
|
publicly:pathname.indexOf("/publicly") > -1
|
|
|
|
|
})
|
|
|
|
|
// let pathname = this.props.location.pathname;
|
|
|
|
|
// this.setState({
|
|
|
|
|
// publicly:pathname.indexOf("/publicly") > -1
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -92,16 +92,16 @@ class BanksIndex extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
|
if(prevProps.current_user!=this.props.current_user){
|
|
|
|
|
let { publicly }=this.state;
|
|
|
|
|
if( this.props.checkIfLogin()) {
|
|
|
|
|
if (this.props.current_user && this.props.current_user.professional_certification == false && publicly){
|
|
|
|
|
this.props.history.push(`/topicbank/${this.props.current_user.login}/publicly`);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.props.showLoginDialog()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// if(prevProps.current_user!=this.props.current_user){
|
|
|
|
|
// let { publicly }=this.state;
|
|
|
|
|
// if( this.props.checkIfLogin()) {
|
|
|
|
|
// if (this.props.current_user && this.props.current_user.professional_certification == false && publicly){
|
|
|
|
|
// this.props.history.push(`/topicbank/${this.props.current_user.login}/publicly`);
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// this.props.showLoginDialog()
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// let { publicly }=this.state;
|
|
|
|
|
// if(this.props.current_user && this.props.current_user.professional_certification == false && publicly){
|
|
|
|
|
// if( this.props.checkIfLogin()) {
|
|
|
|
|