From 1d8dd3ca3e6d9b0b4a3cb4f6ba462a3de19daacf Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Fri, 20 Jan 2023 21:55:41 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Updated=20AirDC++=20socket=20con?= =?UTF-8?q?nection=20code=20app-wide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/actions/airdcpp.actions.tsx | 24 ++++-------------------- src/client/components/Navbar.tsx | 1 - src/client/reducers/airdcpp.reducer.ts | 1 + src/client/services/api/SearchApi.ts | 2 +- 4 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/client/actions/airdcpp.actions.tsx b/src/client/actions/airdcpp.actions.tsx index 42ced77..b63268b 100644 --- a/src/client/actions/airdcpp.actions.tsx +++ b/src/client/actions/airdcpp.actions.tsx @@ -64,11 +64,7 @@ export const search = async (dispatch) => { try { if (!ADCPPSocket.isConnected()) { - await ADCPPSocket.connect( - credentials.username, - credentials.password, - true, - ); + await ADCPPSocket(); } const instance: SearchInstance = await ADCPPSocket.post("search"); dispatch({ @@ -154,11 +150,7 @@ export const downloadAirDCPPItem = async (dispatch) => { try { if (!ADCPPSocket.isConnected()) { - await ADCPPSocket.connect( - `${credentials.username}`, - `${credentials.password}`, - true, - ); + await ADCPPSocket.connect(); } let bundleDBImportResult = {}; const downloadResult = await ADCPPSocket.post( @@ -203,11 +195,7 @@ export const getBundlesForComic = async (dispatch) => { try { if (!ADCPPSocket.isConnected()) { - await ADCPPSocket.connect( - `${credentials.username}`, - `${credentials.password}`, - true, - ); + await ADCPPSocket.connect(); } const comicObject = await axios({ method: "POST", @@ -241,11 +229,7 @@ export const getTransfers = (ADCPPSocket: any, credentials: any) => async (dispatch) => { try { if (!ADCPPSocket.isConnected()) { - await ADCPPSocket.connect( - `${credentials.username}`, - `${credentials.password}`, - true, - ); + await ADCPPSocket.connect(); } const bundles = await ADCPPSocket.get("queue/bundles/1/85", {}); if (!isNil(bundles)) { diff --git a/src/client/components/Navbar.tsx b/src/client/components/Navbar.tsx index ef35f53..6de6dde 100644 --- a/src/client/components/Navbar.tsx +++ b/src/client/components/Navbar.tsx @@ -20,7 +20,6 @@ const Navbar: React.FunctionComponent = (props) => { const socketDisconnectionReason = useSelector( (state: RootState) => state.airdcpp.socketDisconnectionReason, ); - return (