@@ -72,7 +72,7 @@ socket.onmessage = function (event) {
72
72
case 'error' : return handleError ( data ) ;
73
73
case 'force-username' : return forceUsername ( data ) ;
74
74
case 'give-answer' : return giveAnswer ( data ) ;
75
- case 'give-answer-live-update' : return logGiveAnswer ( data , true ) ;
75
+ case 'give-answer-live-update' : return logGiveAnswer ( data ) ;
76
76
case 'initiated-vk' : return vkInit ( data ) ;
77
77
case 'join' : return join ( data ) ;
78
78
case 'leave' : return leave ( data ) ;
@@ -333,7 +333,7 @@ async function giveAnswer ({ celerity, directive, directedPrompt, givenAnswer, p
333
333
document . getElementById ( 'answer-input' ) . value = '' ;
334
334
document . getElementById ( 'answer-input-group' ) . classList . add ( 'd-none' ) ;
335
335
document . getElementById ( 'answer-input' ) . blur ( ) ;
336
- logGiveAnswer ( { directive, message : givenAnswer , username } ) ;
336
+ logGiveAnswer ( { directive, givenAnswer, username } ) ;
337
337
338
338
if ( directive === 'prompt' && directedPrompt ) {
339
339
logEventConditionally ( username , `was prompted with "${ directedPrompt } "` ) ;
@@ -448,7 +448,7 @@ function logEventConditionally (username, message) {
448
448
document . getElementById ( 'room-history' ) . prepend ( li ) ;
449
449
}
450
450
451
- function logGiveAnswer ( { directive = null , message , username } ) {
451
+ function logGiveAnswer ( { directive = null , givenAnswer , username } ) {
452
452
const badge = document . createElement ( 'span' ) ;
453
453
badge . textContent = 'Buzz' ;
454
454
switch ( directive ) {
@@ -470,7 +470,7 @@ function logGiveAnswer ({ directive = null, message, username }) {
470
470
b . textContent = username ;
471
471
472
472
const span = document . createElement ( 'span' ) ;
473
- span . textContent = message ;
473
+ span . textContent = givenAnswer ;
474
474
475
475
let li ;
476
476
if ( document . getElementById ( 'live-buzz' ) ) {
@@ -849,14 +849,14 @@ document.getElementById('answer-form').addEventListener('submit', function (even
849
849
} ) ;
850
850
851
851
document . getElementById ( 'answer-input' ) . addEventListener ( 'input' , function ( ) {
852
- socket . send ( JSON . stringify ( { type : 'give-answer-live-update' , message : this . value } ) ) ;
852
+ socket . send ( JSON . stringify ( { type : 'give-answer-live-update' , givenAnswer : this . value } ) ) ;
853
853
} ) ;
854
854
855
855
document . getElementById ( 'buzz' ) . addEventListener ( 'click' , function ( ) {
856
856
this . blur ( ) ;
857
857
if ( audio . soundEffects ) audio . buzz . play ( ) ;
858
858
socket . send ( JSON . stringify ( { type : 'buzz' } ) ) ;
859
- socket . send ( JSON . stringify ( { type : 'give-answer-live-update' , message : '' } ) ) ;
859
+ socket . send ( JSON . stringify ( { type : 'give-answer-live-update' , givenAnswer : '' } ) ) ;
860
860
} ) ;
861
861
862
862
document . getElementById ( 'chat' ) . addEventListener ( 'click' , function ( ) {
0 commit comments