Update: 更新主进程
This commit is contained in:
6
main.js
6
main.js
@@ -23,12 +23,12 @@ let cloudSoftwareJson = null;
|
|||||||
const usbDetection = require('usb-detection');
|
const usbDetection = require('usb-detection');
|
||||||
|
|
||||||
usbDetection.startMonitoring();
|
usbDetection.startMonitoring();
|
||||||
usbDetection.on('change', (device) => {
|
usbDetection.on('add', (device) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
sendCommand({
|
sendCommand({
|
||||||
obj: 'Mixly.Electron.Serial',
|
obj: 'Mixly.Electron.Serial',
|
||||||
func: 'refreshPorts',
|
func: 'refreshPorts',
|
||||||
args: []
|
args: [device]
|
||||||
});
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
});
|
});
|
||||||
@@ -38,7 +38,7 @@ usbDetection.on('remove', (device) => {
|
|||||||
sendCommand({
|
sendCommand({
|
||||||
obj: 'Mixly.Electron.Serial',
|
obj: 'Mixly.Electron.Serial',
|
||||||
func: 'refreshPorts',
|
func: 'refreshPorts',
|
||||||
args: []
|
args: [device]
|
||||||
});
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user