clean up active device selection

when clicking first column
This commit is contained in:
sparks-alec
2023-06-11 22:59:24 -04:00
parent eb1d120345
commit 5accc828db
3 changed files with 6 additions and 17 deletions
+2 -16
View File
@@ -91,6 +91,8 @@ window.init = function init() {
const deviceID = e.srcElement.id;
if (e.srcElement.id !== 'device-list') {
VIEW.switchDevice(deviceID);
} else {
VIEW.switchDevice(undefined);
}
};
@@ -125,22 +127,6 @@ window.init = function init() {
}
}
};
document.getElementById('device-list-col').onclick = function deviceListClick(e) {
try {
document.querySelector('#device-list .active-device').classList.remove('active-device');
ipcRenderer.send('disableDeviceDropdown', '');
} catch (err) {
// console.log(err)
}
try {
document.getElementsByClassName('active-device-outline')[0].classList.remove('active-device-outline');
} catch (err) {
// console.log(err)
}
VIEW.switchDevice();
};
};
ipcRenderer.on('setActiveDevicePinned', (event, message) => {
-1
View File
@@ -343,7 +343,6 @@ function heartbeat() {
d.sendQueue.shift();
}
});
document.getElementById('network-indicator-dot').style.background = '#111';
}
setInterval(heartbeat, 50);
+4
View File
@@ -162,6 +162,10 @@ function switchDevice(id) {
if (id === undefined) {
document.getElementById('refresh-device-button').disabled = true;
document.getElementById('device-settings-table').style.display = 'none';
const $activeDevice = document.querySelector('.active-device');
if ($activeDevice) {
$activeDevice.classList.remove('active-device');
}
return;
}