From 5ff53f1e21d4019e6946a9db3001b18a96ab5651 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Tue, 28 Nov 2023 22:52:28 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=EF=B8=8F=20Cleanup=20of=20the=20se?= =?UTF-8?q?arch=20results=20pane?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ComicDetail/AcquisitionPanel.tsx | 38 ++++++++++++------- .../AirDCPPSettings/AirDCPPHubsForm.tsx | 6 ++- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/client/components/ComicDetail/AcquisitionPanel.tsx b/src/client/components/ComicDetail/AcquisitionPanel.tsx index 0e3752e..2b25188 100644 --- a/src/client/components/ComicDetail/AcquisitionPanel.tsx +++ b/src/client/components/ComicDetail/AcquisitionPanel.tsx @@ -235,11 +235,7 @@ export const AcquisitionPanel = ( className="input main-search-bar is-medium" placeholder="Type an issue/volume name" /> - - This is the auto-detected title; you may need to - change it to get better matches if the - auto-detected one doesn't work. - + ); }} @@ -303,7 +299,7 @@ export const AcquisitionPanel = (

{result.type.id === "directory" ? ( - ) : null}{" "} + ) : null} {ellipsize(result.name, 70)}

@@ -343,7 +339,8 @@ export const AcquisitionPanel = ( - downloadDCPPResult( searchInstance.id, @@ -354,8 +351,11 @@ export const AcquisitionPanel = ( ) } > - - + + + + Download + ); @@ -367,10 +367,22 @@ export const AcquisitionPanel = (
- Searching via AirDC++ is still in{" "} - alpha. Some searches may take arbitrarily long, - or may not work at all. Searches from ADCS hubs are - more reliable than NMDCS ones. +

+ The default search term is an auto-detected title; you may + need to change it to get better matches if the auto-detected + one doesn't work. +

+
+
+ +
+
+

+ Searching via AirDC++ is still in + alpha. Some searches may take arbitrarily + long, or may not work at all. Searches from ADCS + hubs are more reliable than NMDCS ones. +

diff --git a/src/client/components/Settings/AirDCPPSettings/AirDCPPHubsForm.tsx b/src/client/components/Settings/AirDCPPSettings/AirDCPPHubsForm.tsx index c6efbb5..845d2a8 100644 --- a/src/client/components/Settings/AirDCPPSettings/AirDCPPHubsForm.tsx +++ b/src/client/components/Settings/AirDCPPSettings/AirDCPPHubsForm.tsx @@ -37,9 +37,11 @@ export const AirDCPPHubsForm = (): ReactElement => { const { data: hubs } = useQuery({ queryKey: [], queryFn: async () => await airDCPPSocketInstance.get(`hubs`), + enabled: !!settings, }); let hubList = {}; - if (!isNil(hubs)) { + if (!isEmpty(hubs)) { + console.log("hs", hubs); hubList = hubs.map(({ hub_url, identity }) => ({ value: hub_url, label: identity.name, @@ -69,7 +71,7 @@ export const AirDCPPHubsForm = (): ReactElement => { return ( <> - {!isEmpty(hubList) ? ( + {!isEmpty(hubList) && !isUndefined(hubs) ? (