Add option to copy defaults if prefs are 0kb.
LindirQuenya opened this issue · comments
Is your feature request related to a problem? Please describe.
Sometimes, preferences are wiped and the launcher is unable to start. At such times, the launcher (as of the in-dev hotfix) exits after displaying an error message about the preferences being 0kb. A user in this scenario would need to take a trip to the help channels to get the default preferences. Users would prefer not to do that.
Describe the solution you'd like
Instead of displaying an error and exiting, the launcher should display an error and give the user an option to restore the preferences to the defaults, e.g. Preferences are corrupted, restore to defaults?
->(Yes
, No, quit
). The launcher would need to be packaged with a default preferences.json.
Describe alternatives you've considered
If we got rid of the 0kb issue, this would be irrelevant (unless users manually corrupt their prefs). It's good behavior for a resilient application to have, though.
As an alternative to packaging the default preferences.json with the launcher, we could have a URL in config.json where the default prefs will be hosted. I prefer not to rely on networking - too many failure modes, increases centralization, and the prefs are only a few kb anyway - so I think packaging them with the launcher is a better idea.