Repository navigation
Fix first filter being wiped after a cached launch - #39
Merged
Merged
Conversation
loadMenus() synced the session filters from profile prefs only after the "already loaded" guard. A launch served from the disk cache returned at that guard, so the sync ran on the next load instead, which is the one triggered by Apply Filters, and overwrote the filter the user had just picked. Sync before the cache check. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Bug
Open the app (feed loads instantly from the disk cache) → Filter → pick Vegan → Apply. The overlay closes but the feed is unfiltered. Applying a second time works.
Cause
loadMenus()syncs the session filters from profile prefs once per session, but that block sat after the "already loaded" guard. A cached launch returns at the guard, so the sync ran on the next load instead, the one triggered by Apply, and overwrote the just-selected filters with profile defaults.Fix
Run the sync before the cache check. iOS only; no API change.
Verified
Simulator, fresh guest: before the fix the feed still led with Buffalo Chicken Pizza after applying Vegan; after the fix it shows only vegan dishes and the filter badge.
🤖 Generated with Claude Code