Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Webapp not compiling in src/components/Game/component.js #20

Open
mishafeingold opened this issue Aug 21, 2019 · 0 comments
Open

Webapp not compiling in src/components/Game/component.js #20

mishafeingold opened this issue Aug 21, 2019 · 0 comments

Comments

@mishafeingold
Copy link

mishafeingold commented Aug 21, 2019

This section of the tutorial has an incorrectly written if statement.

	question = () => {
		/* CODE GOES HERE */
		let questionId = this.state.question.onCreateQuestion.id;
		if(this.state.questionAvailable){
			setTimeout((() => {
				if(this.state.answerChosen == null){
					this.answerChosen(-1);
				}
				if (this.state.question.onCreateQuestion.id == questionId) {
					this.setState({
						modalVisible: false,
						questionAvailable: false,
						buttonsDisabled: true,
						selectedAnswerButton: null
					});
				});
			}).bind(this), 10000);
			return(
				<div className="question-container">
					<div className="question">
						<div className="question-title-container">
							<div className="question-title">{ this.state.question.onCreateQuestion.question }</div>
						</div>
						<div className="answers-container">
							<div className="answers">
								{ this.answerButtons() }
							</div>	
						</div>
					</div>
				</div>
			);
		}	
	}

I believe this should be able to fix it:

	question = () => {
		/* CODE GOES HERE */
		let questionId = this.state.question.onCreateQuestion.id;
		if(this.state.questionAvailable){
			setTimeout((() => {
				if(this.state.answerChosen == null){
					this.answerChosen(-1);
				}
				if (this.state.question.onCreateQuestion.id == questionId) {
					this.setState({
						modalVisible: false,
						questionAvailable: false,
						buttonsDisabled: true,
						selectedAnswerButton: null
					});
				}
			}).bind(this), 10000);
			return(
				<div className="question-container">
					<div className="question">
						<div className="question-title-container">
							<div className="question-title">{ this.state.question.onCreateQuestion.question }</div>
						</div>
						<div className="answers-container">
							<div className="answers">
								{ this.answerButtons() }
							</div>	
						</div>
					</div>
				</div>
			);
		}	
	}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant