Fix streaming service filter persistence in WatchProviderSelector #4191
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.
Issue
When adding filters for Series and Movies, the streaming service filter does not persist across open/close of the filter panel. The filtering works correctly (URL parameters are maintained), but when reopening the filter panel, no streaming service appears selected.
Root Cause
The
WatchProviderSelectorcomponent uses internal state (activeProviderandwatchRegion) that gets initialized once withuseState()but doesn't update when the props (activeProvidersandregion) change. When the filter panel reopens, the props contain the correct values from URL query params, but the internal state is stale.Solution
Added
useEffecthooks to synchronize the internal state with the prop values whenever they change:Technical Details
!== undefinedchecks to properly handle empty arrays (when user clears selections)Testing
This fix ensures that when users reopen the filter panel, their streaming service selections are properly restored from the URL parameters.
Fixes #4159.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
download.cypress.io/usr/local/bin/node index.js --exec install(dns block)fonts.googleapis.comnode /home/REDACTED/work/overseerr/overseerr/node_modules/.bin/next build(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.