Skip to content

Commit

Permalink
fix: Don't override configured SD Logs value when opening edit screen (
Browse files Browse the repository at this point in the history
…#3755)

changes:
- set default value only if SF is created
  • Loading branch information
mha1 authored and pfeerick committed Jul 4, 2023
1 parent 69e9bcd commit d214962
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion radio/src/gui/colorlcd/special_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ class SpecialFunctionEditPage : public Page
break;

case FUNC_LOGS: {
CFN_PARAM(cfn) = SD_LOGS_PERIOD_DEFAULT; // set default value
if(CFN_PARAM(cfn) == 0) // use stored value if SF exists
CFN_PARAM(cfn) = SD_LOGS_PERIOD_DEFAULT; // otherwise initialize with default value

auto edit = addNumberEdit(line, STR_INTERVAL, cfn, SD_LOGS_PERIOD_MIN, SD_LOGS_PERIOD_MAX);
edit->setDefault(SD_LOGS_PERIOD_DEFAULT); // set default period for DEF button
Expand Down

0 comments on commit d214962

Please sign in to comment.