Skip to content

Commit

Permalink
additional validation for trivia settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Petersen committed Aug 31, 2021
1 parent d1df484 commit ee6dade
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ async function checkEnabled() {
loadedSettings.triviaCategories.length !== 0 &&
loadedSettings.triviaTimer !== undefined &&
loadedSettings.triviaNumber !== undefined &&
loadedSettings.triviaFrequency !== undefined &&
loadedSettings.enableTrivia !== 'false'
) {
isTriviaEnabled = true;
Expand Down
2 changes: 1 addition & 1 deletion myviews/settings.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@
</div>
<div class="form-group">
<label for="triviaTimer">Number of questions</label>
<input type="text" class="form-control" id="triviaNumber" name="triviaNumber" aria-describedby="triviaNumber" placeholder=""
<input type="text" class="form-control" id="triviaNumber" name="triviaNumber" aria-describedby="triviaNumber" placeholder="Suggest 3"
value="<% if(typeof formData !== 'undefined' && errors){%><%=formData.triviaNumber%>"<%}else{%><%=settings.triviaNumber%>"<%}%>>
<small id="triviaNumberHelp" class="form-text text-muted">Enter the number of questions for each category to display.</small>
</div>
Expand Down

0 comments on commit ee6dade

Please sign in to comment.