From 2906e306cb5618326723776352dcacae7e185826 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 5 Feb 2024 16:24:04 -0800 Subject: [PATCH] reorganize a bit of code for clarity --- src/renderer/App.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/renderer/App.js b/src/renderer/App.js index f3a5b7a2f..e67748002 100644 --- a/src/renderer/App.js +++ b/src/renderer/App.js @@ -179,21 +179,24 @@ const App = (props) => { const newActiveDevice = new ActiveDevice(); setActiveDevice(newActiveDevice); - if (!focus.focusDeviceDescriptor?.bootloader) { - console.info("Probing for focus support..."); - focus.setLayerSize(focus.focusDeviceDescriptor); - console.info("Set the layer size", focus.focusDeviceDescriptor); + if (focus.focusDeviceDescriptor?.bootloader) { + setConnected(true); + + await navigate("/focus-not-detected"); + return true; } + console.info("Probing for focus support..."); + focus.setLayerSize(focus.focusDeviceDescriptor); + console.info("Set the layer size", focus.focusDeviceDescriptor); + i18n.refreshHardware(focus.focusDeviceDescriptor); setFocusDeviceDescriptor(null); - if (!focus.focusDeviceDescriptor?.bootloader) { - await newActiveDevice.loadConfigFromDevice(); - } + await newActiveDevice.loadConfigFromDevice(); setConnected(true); - await navigate(newActiveDevice.focusDetected() ? "/editor" : "/focus-not-detected"); + await navigate("/editor"); return true; };