From 9937f1de70c4e1544aeadd1dcf9a1e49b88adf52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Tue, 30 Jul 2024 13:48:48 +0800 Subject: [PATCH] =?UTF-8?q?Update:=20=E6=9B=B4=E6=96=B0=E4=B8=BB=E8=BF=9B?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 9a3af1a9..ba540901 100644 --- a/main.js +++ b/main.js @@ -23,12 +23,12 @@ let cloudSoftwareJson = null; const usbDetection = require('usb-detection'); usbDetection.startMonitoring(); -usbDetection.on('change', (device) => { +usbDetection.on('add', (device) => { setTimeout(() => { sendCommand({ obj: 'Mixly.Electron.Serial', func: 'refreshPorts', - args: [] + args: [device] }); }, 1000); }); @@ -38,7 +38,7 @@ usbDetection.on('remove', (device) => { sendCommand({ obj: 'Mixly.Electron.Serial', func: 'refreshPorts', - args: [] + args: [device] }); }, 1000); });