Skip to content

Commit

Permalink
Only do demo mode on the active venue
Browse files Browse the repository at this point in the history
  • Loading branch information
thordy committed Jun 17, 2024
1 parent 2fc78ae commit 6734ce4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 0 additions & 2 deletions routes/lib/socketio_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ module.exports = (io, app) => {
data.messages = demo.messages;

nsp.emit('demo', data);
nsp.emit('say', { audios: audios });
nsp.emit('alert', { alerts: demo.messages });

});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ module.exports = {
}
}
});
socket.on('say', (data) => {
socket.on('demo', (data) => {
if (this.state.options.venue_id !== data.venue.id) {
return;
}

const audioPlayers = [ ];
for (const file of data.audios) {
audioPlayers.push(new Audio(file.file));
Expand All @@ -115,9 +119,8 @@ module.exports = {
}
}
audioPlayers[0].play();
});
socket.on('alert', (data) => {
const messages = data.alerts;

const messages = data.messages;
let delay = 0;
messages.forEach((message) => {
delay += (message.delay ? message.delay : 0) * 1000;
Expand Down

0 comments on commit 6734ce4

Please sign in to comment.