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