Compare commits

...

2 Commits

Author SHA1 Message Date
a18644d40e Null checks 2020-12-13 16:27:47 +00:00
02b7708976 Check for vibrate function 2020-12-11 08:36:17 +00:00
4 changed files with 15 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
FROM node:12
FROM node:14
WORKDIR /app

View File

@@ -108,9 +108,11 @@ function reset(roomId) {
room.canBuzz = true;
room.participants.forEach(p => {
if (p.ws) {
p.ws.send(JSON.stringify({
type: "reset"
}));
}
});
}
@@ -137,11 +139,13 @@ function updateScore(roomId, participantId, points) {
participant.score += points;
if (participant.ws) {
participant.ws.send(JSON.stringify({
type: "score",
score: participant.score,
}));
}
}
room.audience.forEach(ws => {
ws.send(JSON.stringify({

View File

@@ -65,7 +65,7 @@
};
function beep() {
window.navigator.vibrate(500);
if (window.navigator.vibrate) window.navigator.vibrate(500);
}
function updateScore(participantId, points) {

View File

@@ -69,7 +69,7 @@
});
function showMessage(msg) {
window.navigator.vibrate(500);
if (window.navigator.vibrate) window.navigator.vibrate(500);
document.getElementById('buzzer').disabled = true;
var mb = document.getElementById('messageBox');
mb.innerHTML = msg;
@@ -91,7 +91,7 @@
}
function beep() {
window.navigator.vibrate(500);
if (window.navigator.vibrate) window.navigator.vibrate(500);
}
</script>
</body>