mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Fix serial device ignore
This commit is contained in:
parent
1027ea1b98
commit
1f38a59bb8
1 changed files with 9 additions and 2 deletions
|
@ -3,8 +3,6 @@ import { getAudioDevices, getSerialDevices } from "./api";
|
|||
let audioDevices = await getAudioDevices();
|
||||
let serialDevices = await getSerialDevices();
|
||||
|
||||
//Add an ignore option for rig and ptt for transceivers that don't require them
|
||||
serialDevices.push({ description: "-- ignore --", port: "ignore" });
|
||||
|
||||
//Dummy device data sent if unable to get devices from modem to prevent GUI crash
|
||||
const skel = JSON.parse(`
|
||||
|
@ -43,5 +41,14 @@ export function audioOutputOptions() {
|
|||
}
|
||||
|
||||
export function serialDeviceOptions() {
|
||||
//Return ignore option if no serialDevices
|
||||
if (serialDevices === undefined)
|
||||
return [{ description: "-- ignore --", port: "ignore" }];
|
||||
|
||||
if (serialDevices.findIndex((device) => device.port == 'ignore') == -1) {
|
||||
//Add an ignore option for rig and ptt for transceivers that don't require them
|
||||
serialDevices.push({ description: "-- ignore --", port: "ignore" })
|
||||
}
|
||||
|
||||
return serialDevices;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue