open-nomie / nomie6-oss

Opensource version of Nomie 6
MIT License
505 stars 56 forks source link

fix: fetch and cache location on app startup #43

Closed qcasey closed 1 year ago

qcasey commented 1 year ago

Discussed in #12.

It's been working well for the most part. Sometimes (maybe 1 in 20) the location isn't fetched on load so I end up waiting the full 9 second timeout I configured like before. Still an improvement though.

I don't see the downside to this implementation, even if a device can fetch its location relatively quickly this should make the first (and every) Log instant.

netlify[bot] commented 1 year ago

Deploy Preview for nomie6-oss ready!

Name Link
Latest commit 9fd6fde7d535034c0b642fbf8e830dea9b98e521
Latest deploy log https://app.netlify.com/sites/nomie6-oss/deploys/63dafd4b1188f20009d2dca4
Deploy Preview https://deploy-preview-43--nomie6-oss.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

donalmacanri commented 1 year ago

Looks good. If I have never opened the app before, it now asks for my location immediately, before the user has indicated they wish to track location. I think that's because the enable location tracking preference must be set to true by default. We should probably wait until after the user has completed onboarding (onboarded pref === true) before requesting it from the browser.

donalmacanri commented 1 year ago

Awesome, great improvement!

qcasey commented 1 year ago

Good catch, I found a better placement for this snippet which should do that, and negates the need for a prefs import as well.

Forgot to hit reply after testing :laughing: