[CodeFactor] Apply fixes to commit 4cf915c

This commit is contained in:
codefactor-io 2023-11-10 15:09:18 +00:00
parent 4cf915c399
commit 7ba7a435ef
No known key found for this signature in database
GPG key ID: B66B2D63282C190F

View file

@ -17,44 +17,42 @@ export const useAudioStore = defineStore("audioStore", () => {
function getInputDevices() {
var html = "";
if (inputDevices.value.length > 0){
if (inputDevices.value.length > 0) {
for (var key in inputDevices.value) {
let selected = "";
for (var key in inputDevices.value) {
let selected = "";
console.log(
"AUDIO DEVICES: " +
inputDevices.value[key]["id"] +
" | " +
settings.rx_audio,
);
if (inputDevices.value[key]["id"] == settings.rx_audio) {
selected = "selected";
} else {
selected = "";
}
console.log(
"AUDIO DEVICES: " +
inputDevices.value[key]["id"] +
" | " +
settings.rx_audio,
);
if (inputDevices.value[key]["id"] == settings.rx_audio) {
selected = "selected";
} else {
selected = "";
html += `<option value=${inputDevices.value[key]["id"]} ${selected}>${inputDevices.value[key]["name"]} | ${inputDevices.value[key]["api"]}</option>`;
}
html += `<option value=${inputDevices.value[key]["id"]} ${selected}>${inputDevices.value[key]["name"]} | ${inputDevices.value[key]["api"]}</option>`;
}
return html;
return html;
}
}
function getOutputDevices() {
var html = "";
if (outputDevices.value.length > 0){
for (var key in outputDevices.value) {
let selected = "";
if (outputDevices.value[key]["id"] == settings.tx_audio) {
selected = "selected";
} else {
selected = "";
}
html += `<option value=${outputDevices.value[key]["id"]} ${selected}>${outputDevices.value[key]["name"]} | ${outputDevices.value[key]["api"]}</option>`;
if (outputDevices.value.length > 0) {
for (var key in outputDevices.value) {
let selected = "";
if (outputDevices.value[key]["id"] == settings.tx_audio) {
selected = "selected";
} else {
selected = "";
}
return html;
html += `<option value=${outputDevices.value[key]["id"]} ${selected}>${outputDevices.value[key]["name"]} | ${outputDevices.value[key]["api"]}</option>`;
}
return html;
}
}