From 6b508d4c3667e169db21ca00f0ae312ae90ed3fb Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Wed, 11 May 2022 23:40:10 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=AB=20Tweaking=20the=20trigger=20for?= =?UTF-8?q?=20download=20complete=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/actions/airdcpp.actions.tsx | 17 ++++++++++------- src/client/components/Dashboard/PullList.tsx | 2 +- .../components/Dashboard/RecentlyImported.tsx | 17 +++++++++-------- src/client/components/Search.tsx | 6 +++--- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/client/actions/airdcpp.actions.tsx b/src/client/actions/airdcpp.actions.tsx index 3af75d8..bc19c78 100644 --- a/src/client/actions/airdcpp.actions.tsx +++ b/src/client/actions/airdcpp.actions.tsx @@ -18,7 +18,7 @@ import { LS_SINGLE_IMPORT, IMS_COMIC_BOOK_DB_OBJECT_FETCHED, } from "../constants/action-types"; -import { isNil, isUndefined } from "lodash"; +import { isNil } from "lodash"; import axios from "axios"; interface SearchData { @@ -134,16 +134,19 @@ export const downloadAirDCPPItem = `search/${instanceId}/results/${resultId}/download`, ); let downloadStatus = undefined; + let count = 0; // download status check await ADCPPSocket.addListener(`queue`, "queue_file_status", (status) => { if (status.status.completed) { downloadStatus = status; - - dispatch({ - type: LS_SINGLE_IMPORT, - meta: { remote: true }, - data: { downloadStatus, comicObjectId }, - }); + if (count === 0) { + dispatch({ + type: LS_SINGLE_IMPORT, + meta: { remote: true }, + data: { downloadStatus, comicObjectId }, + }); + } + count += 1; } }); diff --git a/src/client/components/Dashboard/PullList.tsx b/src/client/components/Dashboard/PullList.tsx index b022bf9..0176da4 100644 --- a/src/client/components/Dashboard/PullList.tsx +++ b/src/client/components/Dashboard/PullList.tsx @@ -19,7 +19,7 @@ export const PullList = ({ issues }: PullListProps): ReactElement => { useEffect(() => { dispatch( getWeeklyPullList({ - startDate: "2022-5-1", + startDate: "2022-5-17", pageSize: "15", currentPage: "1", }), diff --git a/src/client/components/Dashboard/RecentlyImported.tsx b/src/client/components/Dashboard/RecentlyImported.tsx index 3880284..3c909a1 100644 --- a/src/client/components/Dashboard/RecentlyImported.tsx +++ b/src/client/components/Dashboard/RecentlyImported.tsx @@ -81,14 +81,15 @@ export const RecentlyImported = ({ )} {/* ComicInfo.xml presence */} - {!isNil(sourcedMetadata.comicInfo) && ( - - {"ComicInfo.xml - - )} + {!isNil(sourcedMetadata.comicInfo) && + !isEmpty(sourcedMetadata.comicInfo) && ( + + {"ComicInfo.xml + + )} {/* Issue type */} {isComicBookMetadataAvailable && !isNil( diff --git a/src/client/components/Search.tsx b/src/client/components/Search.tsx index 31d1935..51a5de6 100644 --- a/src/client/components/Search.tsx +++ b/src/client/components/Search.tsx @@ -8,9 +8,9 @@ import { search } from "../services/api/SearchApi"; import { Form, Field } from "react-final-form"; import Card from "./Carda"; -interface ISearchProps { } +interface ISearchProps {} -export const Search = ({ }: ISearchProps): ReactElement => { +export const Search = ({}: ISearchProps): ReactElement => { const formData = { search: "", }; @@ -83,7 +83,7 @@ export const Search = ({ }: ISearchProps): ReactElement => { )} /> {!isNil(comicVineSearchResults.results) && - !isEmpty(comicVineSearchResults.results) ? ( + !isEmpty(comicVineSearchResults.results) ? (
{comicVineSearchResults.results.map((result) => { return (