mirror of
https://github.com/Sonarr/Sonarr
synced 2025-12-07 17:04:42 +01:00
Fixed: Interactive searches when using Escape to close previous searches
This commit is contained in:
parent
8e636d7a37
commit
409823c7e8
2 changed files with 12 additions and 8 deletions
|
|
@ -160,13 +160,17 @@ function InteractiveSearch({ type, searchPayload }: InteractiveSearchProps) {
|
||||||
[dispatch]
|
[dispatch]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(
|
||||||
|
() => {
|
||||||
// Only fetch releases if they are not already being fetched and not yet populated.
|
// Only fetch releases if they are not already being fetched and not yet populated.
|
||||||
|
|
||||||
if (!isFetching && !isPopulated) {
|
if (!isFetching && !isPopulated) {
|
||||||
dispatch(fetchReleases(searchPayload));
|
dispatch(fetchReleases(searchPayload));
|
||||||
}
|
}
|
||||||
}, [isFetching, isPopulated, searchPayload, dispatch]);
|
},
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
const errorMessage = getErrorMessage(error);
|
const errorMessage = getErrorMessage(error);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,10 @@ function SeasonInteractiveSearchModal(
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const handleModalClose = useCallback(() => {
|
const handleModalClose = useCallback(() => {
|
||||||
|
onModalClose();
|
||||||
|
|
||||||
dispatch(cancelFetchReleases());
|
dispatch(cancelFetchReleases());
|
||||||
dispatch(clearReleases());
|
dispatch(clearReleases());
|
||||||
|
|
||||||
onModalClose();
|
|
||||||
}, [dispatch, onModalClose]);
|
}, [dispatch, onModalClose]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue