Fix: 修复在线版HID添加设备时未选择设备也会新增设备的问题
This commit is contained in:
@@ -41,6 +41,9 @@ class WebHID extends Serial {
|
|||||||
const devices = await navigator.hid.requestDevice({
|
const devices = await navigator.hid.requestDevice({
|
||||||
filters: []
|
filters: []
|
||||||
});
|
});
|
||||||
|
if (!devices.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.addPort(devices[0]);
|
this.addPort(devices[0]);
|
||||||
this.refreshPorts();
|
this.refreshPorts();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user