1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-23 02:05:27 +02:00

Fixed: Interactive searches when using Escape to close previous searches

This commit is contained in:
Bogdan 2024-11-01 13:33:13 +02:00 committed by Mark McDowall
parent 8e636d7a37
commit 409823c7e8
2 changed files with 12 additions and 8 deletions

View File

@ -160,13 +160,17 @@ function InteractiveSearch({ type, searchPayload }: InteractiveSearchProps) {
[dispatch]
);
useEffect(() => {
// Only fetch releases if they are not already being fetched and not yet populated.
useEffect(
() => {
// Only fetch releases if they are not already being fetched and not yet populated.
if (!isFetching && !isPopulated) {
dispatch(fetchReleases(searchPayload));
}
}, [isFetching, isPopulated, searchPayload, dispatch]);
if (!isFetching && !isPopulated) {
dispatch(fetchReleases(searchPayload));
}
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[]
);
const errorMessage = getErrorMessage(error);

View File

@ -23,10 +23,10 @@ function SeasonInteractiveSearchModal(
const dispatch = useDispatch();
const handleModalClose = useCallback(() => {
onModalClose();
dispatch(cancelFetchReleases());
dispatch(clearReleases());
onModalClose();
}, [dispatch, onModalClose]);
useEffect(() => {