make a newly manually added device the active device

This commit is contained in:
sparks-alec
2023-01-08 22:17:14 -05:00
parent 1d7ff53c9f
commit d810f3ed40
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -95,7 +95,7 @@ window.init = function init() {
};
document.getElementById('add-device-button').onchange = function addDeviceClick(e) {
DEVICE.registerDevice(
const newDevice = DEVICE.registerDevice(
{
type: e.target.value,
defaultName: 'New Device',
@@ -106,6 +106,7 @@ window.init = function init() {
);
e.target.selectedIndex = 0;
VIEW.switchDevice(newDevice.id);
SAVESLOTS.saveAll();
};
+1 -1
View File
@@ -70,7 +70,7 @@ function registerDevice(newDevice, discoveryMethod) {
VIEW.addDeviceToList(devices[id]);
initDeviceConnection(id);
return true;
return devices[id];
}
module.exports.registerDevice = registerDevice;