pierr3 / TrackAudio

A next generation Audio-For-VATSIM ATC Client for macOS, Linux and Windows
Other
49 stars 11 forks source link

Warn when audio settings need to be reset #144

Closed neilenns closed 3 months ago

neilenns commented 3 months ago

Fixes #143

settings_update

Verified the following configurations work:

  1. Fresh launch with no settings: no prompt, settings dialog, WASAPI auto-selected
  2. Pre-beta settings, audio configured: prompt, settings dialog shows, WASAPI auto-selected
  3. 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.

neilenns commented 3 months ago

Ok, tested with useEffect and it seems to work.