Merge pull request #276 from tm1000/bugfix/delete-devices

Delete devices by null coalesce if never connected
This commit is contained in:
2024-10-30 20:57:02 -05:00
committed by GitHub
3 changed files with 34 additions and 5 deletions
+29
View File
@@ -0,0 +1,29 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Electron: Main",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"runtimeArgs": ["--remote-debugging-port=9223", "."],
"windows": {
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
}
},
{
"name": "Electron: Renderer",
"type": "chrome",
"request": "attach",
"port": 9223,
"webRoot": "${workspaceFolder}",
"timeout": 30000
}
],
"compounds": [
{
"name": "Electron: All",
"configurations": ["Electron: Main", "Electron: Renderer"]
}
]
}
+1 -1
View File
@@ -2,7 +2,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"eslint.validate": ["javascript"],
"html.validate.styles": false // accept templates inside HTML style attributes
+4 -4
View File
@@ -257,13 +257,13 @@ module.exports.deleteActive = function deleteActive() {
if (choice) {
if (device.plugin.config.connectionType === 'TCPsocket') {
device.connection.destroy();
device.connection?.destroy();
} else if (device.plugin.config.connectionType === 'UDPsocket') {
device.connection.close();
device.connection?.close();
} else if (device.plugin.config.connectionType === 'multicast') {
device.connection.close();
device.connection?.close();
} else if (device.plugin.config.connectionType.startsWith('osc')) {
device.connection.close();
device.connection?.close();
}
VIEW.removeDeviceFromList(device);
delete devices[device.id];