Skip to content

Commit

Permalink
Force default CountdownMode to true as mitigation for users impacted by
Browse files Browse the repository at this point in the history
#49

+ minor refactoring
  • Loading branch information
lukaslangrock committed Nov 13, 2024
1 parent 78a3e15 commit 3a373c9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/ShutdownTimer/Helpers/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,21 @@ private static void CheckSettings()
catch { ExceptionHandler.LogEvent("[Settings] Part " + (i + 1).ToString() + " of settings version number unreadable '" + importVerString[i] + "' filling with 0"); }
}

if (importVer[0] < 2) // for < 2.0.0.0
if (importVer[0] == 1) // everything v1.X
{
if (importVer[1] < 3) // < 1.3.0.0
if (importVer[1] < 3) // for < v1.3
{
// Issue #49: When reading from earlier settings version DefaultTimer.CountdownMode does not exist and is initialized as false but default should be true
Settings.DefaultTimer.CountdownMode = true;
ExceptionHandler.LogEvent("[Settings] Set DefaultTimer.CountdownMode to true as migration step from <v1.3");
}

if (importVer[1] == 3 && importVer[2] == 0) // for = v1.3.0
{
// Issue #49: Same as above, except we force change this to lessen the general impact of the issue.
// It's not very nice, especially for people who were not impact and changed this to false manually, but the group impacted is way larger than the one not impacted
Settings.DefaultTimer.CountdownMode = true;
ExceptionHandler.LogEvent("[Settings] Forced DefaultTimer.CountdownMode to true as mitigation for users impacted by Issue #49");
}
}
}
Expand Down

0 comments on commit 3a373c9

Please sign in to comment.