Skip to content

Commit

Permalink
Merge pull request #83 from THagenmaier/Bugfix_writeConfig
Browse files Browse the repository at this point in the history
Bugfix: unnötige writeConfig() Aufrufe beim Start
  • Loading branch information
shining-man authored Feb 16, 2024
2 parents 4e37df5 + 4ca40ca commit 1e7d29c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/WebSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,13 @@ void WebSettings::initWebSettings(const char *parameter, String confName, String
readConfig();
}
getDefaultValuesFromNewKeys(parameterFile, 8);
if(bo_hasNewKeys) writeConfig();

if(bo_hasNewKeys)
{
writeConfig();
bo_hasNewKeys = false;
}

#ifdef WEBSET_DEBUG
BSC_LOGI(TAG, "initWebSettings() end");
#endif
Expand Down Expand Up @@ -681,7 +687,7 @@ void WebSettings::getDefaultValuesFromNewKeys(const char *parameter, uint32_t js
retStr_default="";
json.getValue(parameter, a, "default", jsonStartPos, retStr_default, u32_tmp);

if(isKeyExist(jsonName, u8_dataType)==false)
if((jsonNameBase!= 0) && (isKeyExist(jsonName, u8_dataType)==false))
{
bo_hasNewKeys=true;
uint16_t id=0;
Expand All @@ -693,7 +699,7 @@ void WebSettings::getDefaultValuesFromNewKeys(const char *parameter, uint32_t js
}
else
{
if(prefs.isKey(String(jsonName).c_str())==false)
if((jsonNameBase != 0) && (prefs.isKey(String(jsonName).c_str())==false))
{
bo_hasNewKeys=true;
retStr_default="";
Expand Down

0 comments on commit 1e7d29c

Please sign in to comment.