Skip to content

Commit

Permalink
Merge pull request #6 from rjfc/backend
Browse files Browse the repository at this point in the history
Added case if no flashcards could be generated
  • Loading branch information
rjfc committed Sep 15, 2019
2 parents 5f8ce42 + ee33756 commit d68bca0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions public/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ socket.on("termData", function(termData) {
console.log(termData);
questions = termData.questions;
answers = termData.answers;
if (questions.length == 0) {
$(".flashcard > h1").text("No flashcards could be generated.");
}
console.log(questions[clickCounter]);
$(".flashcard > h1").text(questions[clickCounter].charAt(0).toUpperCase() + questions[clickCounter].slice(1) + "...");
$(".flashcard-container > span").text("Displaying term " + (clickCounter + 1) + " of " + answers.length);
Expand Down

0 comments on commit d68bca0

Please sign in to comment.