fix: correctly restore selected streaming service filters (#3249)

pull/3250/head
Ryan Cohen 2 years ago committed by GitHub
parent 6fd11cf425
commit 154f3e72ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -76,8 +76,8 @@ const RegionSelector = ({
}, [value, regions, allRegion]);
useEffect(() => {
if (onChange && regions) {
onChange(name, selectedRegion?.iso_3166_1 ?? '');
if (onChange && regions && selectedRegion) {
onChange(name, selectedRegion.iso_3166_1);
}
}, [onChange, selectedRegion, name, regions]);

@ -307,10 +307,6 @@ export const WatchProviderSelector = ({
onChange(watchRegion, activeProvider);
}, [activeProvider, watchRegion, onChange]);
useEffect(() => {
setActiveProvider([]);
}, [watchRegion]);
const orderedData = useMemo(() => {
if (!data) {
return [];
@ -335,7 +331,12 @@ export const WatchProviderSelector = ({
<RegionSelector
value={watchRegion}
name="watchRegion"
onChange={(_name, value) => setWatchRegion(value)}
onChange={(_name, value) => {
if (value !== watchRegion) {
setActiveProvider([]);
}
setWatchRegion(value);
}}
disableAll
watchProviders
/>

Loading…
Cancel
Save