Merge branch 'assessment' into backend-connection

This commit is contained in:
Delucse
2020-12-01 14:43:25 +01:00
6 changed files with 64 additions and 59 deletions
+2 -4
View File
@@ -22,17 +22,14 @@ class Tutorial extends Component {
componentDidMount() {
this.props.getTutorial(this.props.match.params.tutorialId);
// this.props.tutorialId(Number(this.props.match.params.tutorialId));
}
componentDidUpdate(props, state) {
if(this.props.tutorial && !this.props.isLoading && this.props.tutorial._id != this.props.match.params.tutorialId) {
this.props.getTutorial(this.props.match.params.tutorialId);
// this.props.tutorialId(Number(this.props.match.params.tutorialId));
}
if(this.props.message.id === 'GET_TUTORIAL_FAIL'){
alert(this.props.message.msg);
this.props.clearMessages();
}
}
@@ -48,7 +45,8 @@ class Tutorial extends Component {
return (
<div>
{this.props.isLoading ? null :
!this.props.tutorial ? <NotFound button={{ title: 'Zurück zur Tutorials-Übersicht', link: '/tutorial' }} />
!this.props.tutorial ?
this.props.message.id === 'GET_TUTORIAL_FAIL' ? <NotFound button={{ title: 'Zurück zur Tutorials-Übersicht', link: '/tutorial' }} /> : null
: (() => {
var tutorial = this.props.tutorial;
var steps = this.props.tutorial.steps;