Adds a new config class that manages everything relating to configs, including migration
Add a method for migrating from v1 to v2 config, which clears the audio settings and updates the AlwaysOnTop property (refactored from a previous release)
Adds a way to force the settings dialog to show from the main process
Automatically show the settings dialog on first run (no saved settings) or audio settings reset (upgrade)
Automatically select the Audio API if there's only one option and the user didn't have one selected already
Force clear invalid config.json files. More on this below.
Handle JSON parsing errors in the config by resetting to the default. More on this below.
Verified the following configurations work:
Fresh launch with no settings: no prompt, settings dialog, WASAPI auto-selected
Beta settings, audio configured: no prompt, no settings dialog
Other notes
When testing I made an empty config.json file thinking that would just be an empty config, but it resulted in an unhandled JSON parsing exception in electron-store. Since the config file isn't meant to be hand-edited I added the option to new Store() to force clear the config if it's invalid instead of throwing an exception.
I also accidentally borked the JSON in a config file which lead to unhandled exceptions being thrown. Solved this by wrapping the parsing in a try/catch and reverting to default config if something went wrong.
Fixes #143
version
property to the configurationVerified the following configurations work:
Other notes
When testing I made an empty config.json file thinking that would just be an empty config, but it resulted in an unhandled JSON parsing exception in electron-store. Since the config file isn't meant to be hand-edited I added the option to
new Store()
to force clear the config if it's invalid instead of throwing an exception.I also accidentally borked the JSON in a config file which lead to unhandled exceptions being thrown. Solved this by wrapping the parsing in a try/catch and reverting to default config if something went wrong.