From a8baa085c724476a02c889e70510af8cb7e6532c Mon Sep 17 00:00:00 2001 From: Djuri Baars Date: Sun, 9 Jun 2024 11:31:25 +0200 Subject: [PATCH] Fix setting defaults for stealing focus and block countdown --- data | 2 +- src/lib/block_notify.cpp | 2 +- src/lib/screen_handler.cpp | 2 +- src/lib/webserver.cpp | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data b/data index 5b3a071..2b2c8e7 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 5b3a0712847d292d1aefcf8eb2b1062a24556fb2 +Subproject commit 2b2c8e7fc72a4e0108caf63bccb2e8bf0a5f21a0 diff --git a/src/lib/block_notify.cpp b/src/lib/block_notify.cpp index 83a3be3..e109aa7 100644 --- a/src/lib/block_notify.cpp +++ b/src/lib/block_notify.cpp @@ -177,7 +177,7 @@ void onWebsocketBlockMessage(esp_websocket_event_data_t *event_data) // xTaskNotifyGive(blockUpdateTaskHandle); if (getCurrentScreen() != SCREEN_BLOCK_HEIGHT && - preferences.getBool("stealFocus", true)) + preferences.getBool("stealFocus", false)) { uint64_t timerPeriod = 0; if (isTimerActive()) diff --git a/src/lib/screen_handler.cpp b/src/lib/screen_handler.cpp index d1215f6..d0fa761 100644 --- a/src/lib/screen_handler.cpp +++ b/src/lib/screen_handler.cpp @@ -57,7 +57,7 @@ void workerTask(void *pvParameters) { if (getCurrentScreen() != SCREEN_HALVING_COUNTDOWN) { taskEpdContent = parseBlockHeight(getBlockHeight()); } else { - taskEpdContent = parseHalvingCountdown(getBlockHeight(), preferences.getBool("useBlkCountdown", false)); + taskEpdContent = parseHalvingCountdown(getBlockHeight(), preferences.getBool("useBlkCountdown", true)); } if (getCurrentScreen() == SCREEN_HALVING_COUNTDOWN || diff --git a/src/lib/webserver.cpp b/src/lib/webserver.cpp index accc7c2..06fb77c 100644 --- a/src/lib/webserver.cpp +++ b/src/lib/webserver.cpp @@ -569,7 +569,7 @@ void onApiSettingsGet(AsyncWebServerRequest *request) root["otaEnabled"] = preferences.getBool("otaEnabled", true); root["fetchEurPrice"] = preferences.getBool("fetchEurPrice", false); root["useSatsSymbol"] = preferences.getBool("useSatsSymbol", false); - root["useBlkCountdown"] = preferences.getBool("useBlkCountdown", false); + root["useBlkCountdown"] = preferences.getBool("useBlkCountdown", true); root["suffixPrice"] = preferences.getBool("suffixPrice", false); root["disableLeds"] = preferences.getBool("disableLeds", false); @@ -749,10 +749,10 @@ void onApiSettingsPost(AsyncWebServerRequest *request) settingsChanged = true; } - if (request->hasParam("stealFocusOnBlock", true)) + if (request->hasParam("stealFocus", false)) { AsyncWebParameter *stealFocusOnBlock = - request->getParam("stealFocusOnBlock", true); + request->getParam("stealFocus", false); preferences.putBool("stealFocus", stealFocusOnBlock->value().toInt()); settingsChanged = true;