🔫 Tweaking the trigger for download complete action

This commit is contained in:
2022-05-11 23:40:10 -07:00
parent 30ee5e4a67
commit 6b508d4c36
4 changed files with 23 additions and 19 deletions

View File

@@ -18,7 +18,7 @@ import {
LS_SINGLE_IMPORT, LS_SINGLE_IMPORT,
IMS_COMIC_BOOK_DB_OBJECT_FETCHED, IMS_COMIC_BOOK_DB_OBJECT_FETCHED,
} from "../constants/action-types"; } from "../constants/action-types";
import { isNil, isUndefined } from "lodash"; import { isNil } from "lodash";
import axios from "axios"; import axios from "axios";
interface SearchData { interface SearchData {
@@ -134,16 +134,19 @@ export const downloadAirDCPPItem =
`search/${instanceId}/results/${resultId}/download`, `search/${instanceId}/results/${resultId}/download`,
); );
let downloadStatus = undefined; let downloadStatus = undefined;
let count = 0;
// download status check // download status check
await ADCPPSocket.addListener(`queue`, "queue_file_status", (status) => { await ADCPPSocket.addListener(`queue`, "queue_file_status", (status) => {
if (status.status.completed) { if (status.status.completed) {
downloadStatus = status; downloadStatus = status;
if (count === 0) {
dispatch({ dispatch({
type: LS_SINGLE_IMPORT, type: LS_SINGLE_IMPORT,
meta: { remote: true }, meta: { remote: true },
data: { downloadStatus, comicObjectId }, data: { downloadStatus, comicObjectId },
}); });
}
count += 1;
} }
}); });

View File

@@ -19,7 +19,7 @@ export const PullList = ({ issues }: PullListProps): ReactElement => {
useEffect(() => { useEffect(() => {
dispatch( dispatch(
getWeeklyPullList({ getWeeklyPullList({
startDate: "2022-5-1", startDate: "2022-5-17",
pageSize: "15", pageSize: "15",
currentPage: "1", currentPage: "1",
}), }),

View File

@@ -81,14 +81,15 @@ export const RecentlyImported = ({
</span> </span>
)} )}
{/* ComicInfo.xml presence */} {/* ComicInfo.xml presence */}
{!isNil(sourcedMetadata.comicInfo) && ( {!isNil(sourcedMetadata.comicInfo) &&
<span className="icon custom-icon is-small has-text-danger"> !isEmpty(sourcedMetadata.comicInfo) && (
<img <span className="icon custom-icon is-small has-text-danger">
src="/img/comicinfoxml.svg" <img
alt={"ComicInfo.xml file detected."} src="/img/comicinfoxml.svg"
/> alt={"ComicInfo.xml file detected."}
</span> />
)} </span>
)}
{/* Issue type */} {/* Issue type */}
{isComicBookMetadataAvailable && {isComicBookMetadataAvailable &&
!isNil( !isNil(

View File

@@ -8,9 +8,9 @@ import { search } from "../services/api/SearchApi";
import { Form, Field } from "react-final-form"; import { Form, Field } from "react-final-form";
import Card from "./Carda"; import Card from "./Carda";
interface ISearchProps { } interface ISearchProps {}
export const Search = ({ }: ISearchProps): ReactElement => { export const Search = ({}: ISearchProps): ReactElement => {
const formData = { const formData = {
search: "", search: "",
}; };
@@ -83,7 +83,7 @@ export const Search = ({ }: ISearchProps): ReactElement => {
)} )}
/> />
{!isNil(comicVineSearchResults.results) && {!isNil(comicVineSearchResults.results) &&
!isEmpty(comicVineSearchResults.results) ? ( !isEmpty(comicVineSearchResults.results) ? (
<div> <div>
{comicVineSearchResults.results.map((result) => { {comicVineSearchResults.results.map((result) => {
return ( return (