Fetch city locations only once per website visit#5
Merged
therealJonSnow merged 1 commit intomainfrom Jun 18, 2024
Merged
Conversation
- Centralize location fetching in the store, deduplicating API requests, both in code and in network requests - Fix filtered location requests not overwriting previous non-filtered requests: When visiting the main page, the locations for Mannheim were loaded without being filtered to "enabled=true". That then set the first array entry with all locations. When then navigating to Mannheim's page, locations were fetched again, but this time filtered to "enabled=true" and added to the store's array. But when querying the locations for a city from the store, only the first array item matching the city name was returned, which was still the unfiltered list of locations. - Also enable devtools in development (gives you hydration and props warnings in console) - Use new `only_enabled=1` filter added to the Supabase function for getting city locations
✅ Deploy Preview for kryptostadt-info ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
therealJonSnow
approved these changes
Jun 18, 2024
sisou
pushed a commit
that referenced
this pull request
Jun 18, 2024
Fetch city locations only once per website visit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
enabled=true. That then set the first array entry with all locations in the store. When then navigating to Mannheim's page, locations were fetched again, but this time filtered toenabled=trueand added to the store's array. But when querying the locations for a city from the store, only the first array item matching the city name was returned, which was still the unfiltered list of locations.only_enabled=1filter added to the Supabase function for getting city locations