From f433a9983cc6dcaea451a9de6f84a9b98f5ab573 Mon Sep 17 00:00:00 2001 From: sparks-alec Date: Sun, 1 Oct 2023 01:40:32 -0400 Subject: [PATCH] Don't redraw device views when you click on them --- src/view.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/view.js b/src/view.js index 1c144b1..d5c1ee4 100644 --- a/src/view.js +++ b/src/view.js @@ -183,7 +183,12 @@ function switchDevice(id) { } window.switchClass(document.getElementById(id), 'active-device'); - drawDeviceFrame(id); + + if (!DEVICE.all[id].drawn) { + // don't re-draw the whole device frame if it's already drawn + drawDeviceFrame(id); + } + window.switchClass(document.getElementById(`device-${id}`), 'active-device-outline'); document.getElementById('device-settings-table').style.display = 'block';