Update modal open condition

pull/18/head
ayshiff 2018-06-06 09:31:05 +02:00
parent 9074fc9aa3
commit b5c2517f6c
1 changed files with 3 additions and 2 deletions

View File

@ -43,7 +43,9 @@ class App extends Component {
closeModal() { closeModal() {
this.setState({ this.setState({
pastQuestion: null,
modalIsOpen: false, modalIsOpen: false,
pastResponse: null,
start: true, start: true,
score: 0 score: 0
}); });
@ -56,8 +58,7 @@ class App extends Component {
} }
_handleClick(element) { _handleClick(element) {
console.log(element.child +" "+this.state.currentQuestion); if(element.child !== element.question) {
if(element.child !== this.state.currentQuestion || element.child !== null || element.child !== undefined) {
this.setState({ this.setState({
pastQuestion: this.state.currentQuestion , pastQuestion: this.state.currentQuestion ,
pastResponse: element.text, pastResponse: element.text,