Skip to content

Commit

Permalink
fix #327: pausing after answer is revealed
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrey-wu committed Nov 18, 2024
1 parent 5670e85 commit 27a6f94
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions client/multiplayer/room.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ function noQuestionsFound () {

function pause ({ paused, username }) {
logEvent(username, `${paused ? '' : 'un'}paused the game`);
document.getElementById('pause').textContent = paused ? 'Resume' : 'Pause';
}

function revealAnswer ({ answer, question }) {
Expand Down
2 changes: 1 addition & 1 deletion client/multiplayer/room.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/singleplayer/tossups/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function buzz ({ timer, userId, username }) {
if (audio.soundEffects) { audio.buzz.play(); }
if (userId !== USER_ID) { return; }

document.getElementById('pause').disabled = true;
const typeToAnswer = document.getElementById('type-to-answer').checked;
if (typeToAnswer) {
document.getElementById('answer-input-group').classList.remove('d-none');
Expand Down
2 changes: 1 addition & 1 deletion client/singleplayer/tossups/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions quizbowl/TossupRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ export default class TossupRoom extends Room {

pause (userId) {
if (this.buzzedIn) { return false; }
if (this.questionProgress === this.QuestionProgressEnum.ANSWER_REVEALED) { return false; }

this.paused = !this.paused;
if (this.paused) {
Expand Down

0 comments on commit 27a6f94

Please sign in to comment.