@@ -369,29 +369,29 @@ document.addEventListener("DOMContentLoaded", () => {
369369 console . log ( "Clicked the voice button." ) ;
370370 recognition . start ( ) ;
371371 /*voiceBtn.innerText = "Listening...";*/
372- voiceBtn . display = "none" ;
373- voiceSpinner . display = "flex" ;
372+ voiceBtn . style . display = "none" ;
373+ voiceSpinner . style . display = "flex" ;
374374 } ) ;
375375
376376 recognition . onresult = ( event ) => {
377377 const transcript = event . results [ 0 ] [ 0 ] . transcript ;
378378 messageInput . value = transcript ; // Insert the transcribed text
379379 handleSend ( )
380380 voiceBtn . innerText = "" ; // Reset button
381- voiceBtn . display = "flex" ;
382- voiceSpinner . display = "none" ;
381+ voiceBtn . style . display = "flex" ;
382+ voiceSpinner . style . display = "none" ;
383383 } ;
384384
385385 recognition . onerror = ( event ) => {
386386 console . error ( "Speech Recognition Error:" , event . error ) ;
387387 voiceBtn . innerText = "" ; // Reset button
388- voiceBtn . display = "flex" ;
389- voiceSpinner . display = "none" ;
388+ voiceBtn . style . display = "flex" ;
389+ voiceSpinner . style . display = "none" ;
390390 } ;
391391
392392 recognition . onend = ( ) => {
393393 voiceBtn . innerText = "" ; // Reset button after stopping
394- voiceBtn . display = "flex" ;
395- voiceSpinner . display = "none" ;
394+ voiceBtn . style . display = "flex" ;
395+ voiceSpinner . style . display = "none" ;
396396 } ;
397397} ) ;
0 commit comments