Update: 更新主进程
This commit is contained in:
6
main.js
6
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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user