jeremyckahn / farmhand

A resource management game that puts a farm in your hand
https://www.farmhand.life
GNU General Public License v2.0
95 stars 23 forks source link

fix(settings): Prevent invalid state when booting save with Home screen disabled #471

Closed jeremyckahn closed 6 months ago

jeremyckahn commented 6 months ago

What this PR does

This PR fixes two issues that I discovered during development:

  1. The "Show the Home Screen" setting wasn't working properly. The setting's value was persisting, but the app bootup sequence didn't properly account for it. The end result is that the app booted up in an invalid state and broke some views.
  2. There was a spurious warning being logged if the player cycled through views too quickly after booting. This PR improves the asynchronous handling of the dynamic cow image generation to prevent this warning.

How this change can be validated

  1. Open the Settings dialog, disable "Show the Home Screen," save the game, and reboot. Verify that you can cycle through all of the views without seeing any errors.
  2. Cycle through the Cows view as quickly as you can and verify that there are no errors or warnings in the browser console.
vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
farmhand ✅ Ready (Inspect) Visit Preview Dec 20, 2023 9:59pm