|
|
|
@ -55,7 +55,11 @@ class CoursesBanner extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
|
|
if(this.props.match.path==="/courses/:coursesId"){
|
|
|
|
|
if(this.props.user!=undefined){
|
|
|
|
|
this.props.history.push(this.props.user.first_category_url)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.onloadupdatabanner()
|
|
|
|
|
on('updatabanner', this.updatabanner)
|
|
|
|
|
axios.interceptors.response.use((response) => {
|
|
|
|
@ -69,9 +73,17 @@ class CoursesBanner extends Component {
|
|
|
|
|
}
|
|
|
|
|
return response;
|
|
|
|
|
}, (error) => {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
|
if(prevProps.user!=this.props.user){
|
|
|
|
|
if(this.props.match.path==="/courses/:coursesId"){
|
|
|
|
|
if(this.props.user!=undefined){
|
|
|
|
|
this.props.history.push(this.props.user.first_category_url)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
componentWillUnmount() {
|
|
|
|
|
off('updatabanner', this.updatabanner)
|
|
|
|
|
}
|
|
|
|
|