again, don't redraw device views clicked

This should be a more robust fix.
This commit is contained in:
sparks-alec
2023-10-01 02:05:55 -04:00
parent 5b2199b601
commit 8f5e8be1ff
+8 -1
View File
@@ -21,6 +21,10 @@ function drawDeviceFrame(id) {
const d = DEVICE.all[id];
if (d.frameDrawn) {
return true;
}
const str = `
<html>
<head>
@@ -56,6 +60,8 @@ function drawDeviceFrame(id) {
$devicePinned.style.display = 'none';
}
d.frameDrawn = true;
return true;
}
@@ -143,8 +149,9 @@ module.exports.removeDeviceFromList = function removeDeviceFromList(device) {
};
function switchDevice(id) {
if (activeDevice && activeDevice.pinIndex === false) {
if (activeDevice && activeDevice.pinIndex === false && activeDevice.id !== id) {
document.getElementById(`device-${activeDevice.id}`).remove();
activeDevice.frameDrawn = false;
activeDevice = false;
}
activeDevice = DEVICE.all[id];