diff --git a/src/client/components/App.tsx b/src/client/components/App.tsx index 1662e48..2efa3e7 100644 --- a/src/client/components/App.tsx +++ b/src/client/components/App.tsx @@ -21,11 +21,17 @@ import { isEmpty, isUndefined } from "lodash"; import { AIRDCPP_DOWNLOAD_PROGRESS_TICK } from "../constants/action-types"; import { useDispatch } from "react-redux"; +/** + * Method that initializes an AirDC++ socket connection + * 1. Initializes event listeners for download init, tick and complete events + * 2. Handles errors in case the connection to AirDC++ is not established or terminated + * @returns void + */ const AirDCPPSocketComponent = (): ReactElement => { const airDCPPConfiguration = useContext(AirDCPPSocketContext); const dispatch = useDispatch(); useEffect(() => { - const foo = async () => { + const initializeAirDCPPEventListeners = async () => { if ( !isUndefined(airDCPPConfiguration.airDCPPState) && !isEmpty(airDCPPConfiguration.airDCPPState.settings) && @@ -73,7 +79,7 @@ const AirDCPPSocketComponent = (): ReactElement => { ); } }; - foo(); + initializeAirDCPPEventListeners(); }, [airDCPPConfiguration]); return <>; }; diff --git a/src/client/components/ComicVineSearchForm.tsx b/src/client/components/ComicVineSearchForm.tsx index 0b95ce3..55dfba7 100644 --- a/src/client/components/ComicVineSearchForm.tsx +++ b/src/client/components/ComicVineSearchForm.tsx @@ -3,7 +3,6 @@ import { Form, Field } from "react-final-form"; import Collapsible from "react-collapsible"; import { fetchComicVineMatches } from "../actions/fileops.actions"; import { useDispatch } from "react-redux"; -import { refineQuery } from "filename-parser"; /** * Component for performing search against ComicVine