feat: tauri serial polyfill

This commit is contained in:
2023-08-04 00:08:28 +02:00
parent 9c1918e683
commit 42922e7ce0
23 changed files with 660 additions and 486 deletions

View File

@@ -11,7 +11,6 @@ if (browser && import.meta.env.TAURI_FAMILY !== undefined) {
}
export async function getViablePorts(): Promise<SerialPort[]> {
console.log(await navigator.serial.getPorts().then(it => it.map(it => it.getInfo())))
return navigator.serial.getPorts().then(ports => ports.filter(it => it.getInfo().usbVendorId === VENDOR_ID))
}