diff --git a/frontend/src/InteractiveSearch/InteractiveSearch.tsx b/frontend/src/InteractiveSearch/InteractiveSearch.tsx index 6dd3c2f1f..9dff36198 100644 --- a/frontend/src/InteractiveSearch/InteractiveSearch.tsx +++ b/frontend/src/InteractiveSearch/InteractiveSearch.tsx @@ -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); diff --git a/frontend/src/Series/Search/SeasonInteractiveSearchModal.tsx b/frontend/src/Series/Search/SeasonInteractiveSearchModal.tsx index babe59469..bc2a5b753 100644 --- a/frontend/src/Series/Search/SeasonInteractiveSearchModal.tsx +++ b/frontend/src/Series/Search/SeasonInteractiveSearchModal.tsx @@ -23,10 +23,10 @@ function SeasonInteractiveSearchModal( const dispatch = useDispatch(); const handleModalClose = useCallback(() => { + onModalClose(); + dispatch(cancelFetchReleases()); dispatch(clearReleases()); - - onModalClose(); }, [dispatch, onModalClose]); useEffect(() => {