From 654f9e9d2624e89507f997ae344f52d72d79f574 Mon Sep 17 00:00:00 2001 From: gferraro Date: Wed, 7 Aug 2024 16:46:28 +1200 Subject: [PATCH] fix node value --- static/js/audiorecording.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/static/js/audiorecording.ts b/static/js/audiorecording.ts index 5ea02b5..8cf2d92 100644 --- a/static/js/audiorecording.ts +++ b/static/js/audiorecording.ts @@ -145,7 +145,9 @@ function handleModeChange() { function updateAudio() { var data: any = {}; - data["audio-mode"] = document.getElementById("audio-mode-select")?.nodeValue; + data["audio-mode"] = ( + document.getElementById("audio-mode-select") as HTMLSelectElement + ).value; var xmlHttp = new XMLHttpRequest(); xmlHttp.open("POST", "/api/audiorecording", true); @@ -157,7 +159,8 @@ function updateAudio() { xmlHttp.onload = async function () { if (xmlHttp.status == 200) { if ( - document.getElementById("audio-mode-select")?.nodeValue != "Disabled" + (document.getElementById("audio-mode-select") as HTMLSelectElement) + .value != "Disabled" ) { document .getElementById("audio-test-button")