🔧 Fixed bugs with tab changes and state
This commit is contained in:
@@ -105,7 +105,7 @@ export const getComicBooks = (options) => async (dispatch) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const importToDB = (payload) => (dispatch) => {
|
||||
export const importToDB = (payload?: any) => (dispatch) => {
|
||||
try {
|
||||
const comicBookMetadata = {
|
||||
importStatus: {
|
||||
@@ -115,7 +115,7 @@ export const importToDB = (payload) => (dispatch) => {
|
||||
score: "0",
|
||||
},
|
||||
},
|
||||
sourcedMetadata: { comicvine: payload },
|
||||
sourcedMetadata: { comicvine: payload || null },
|
||||
};
|
||||
dispatch({
|
||||
type: IMS_CV_METADATA_IMPORT_CALL_IN_PROGRESS,
|
||||
@@ -164,7 +164,10 @@ export const fetchComicVineMatches = (searchPayload) => (dispatch) => {
|
||||
data: {
|
||||
format: "json",
|
||||
sort: "name%3Aasc",
|
||||
query: issueSearchQuery.searchParams.searchTerms.name,
|
||||
// hack
|
||||
query: issueSearchQuery.searchParams.searchTerms.name
|
||||
.replace(/[^a-zA-Z0-9 ]/g, "")
|
||||
.trim(),
|
||||
fieldList: "id",
|
||||
limit: "20",
|
||||
offset: "0",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import React, { useCallback, useEffect, useState, ReactElement } from "react";
|
||||
import React, { useEffect, ReactElement } from "react";
|
||||
import { getDownloadProgress } from "../actions/airdcpp.actions";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { RootState, SearchInstance } from "threetwo-ui-typings";
|
||||
import { isNil, map } from "lodash";
|
||||
import { RootState } from "threetwo-ui-typings";
|
||||
import { isNil } from "lodash";
|
||||
import prettyBytes from "pretty-bytes";
|
||||
|
||||
interface IDownloadsPanelProps {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
export const CV_API_CALL_IN_PROGRESS = "CV_SEARCH_IN_PROGRESS";
|
||||
export const CV_SEARCH_FAILURE = "CV_SEARCH_FAILURE";
|
||||
export const CV_SEARCH_SUCCESS = "CV_SEARCH_SUCCESS";
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
AIRDCPP_RESULT_DOWNLOAD_INITIATED,
|
||||
AIRDCPP_DOWNLOAD_PROGRESS_TICK,
|
||||
} from "../constants/action-types";
|
||||
import { LOCATION_CHANGE } from "connected-react-router";
|
||||
|
||||
const initialState = {
|
||||
isAirDCPPSearchInProgress: false,
|
||||
@@ -49,6 +50,10 @@ function airdcppReducer(state = initialState, action) {
|
||||
...state,
|
||||
downloadProgressData: action.downloadProgressData,
|
||||
};
|
||||
case LOCATION_CHANGE:
|
||||
return {
|
||||
initialState,
|
||||
};
|
||||
|
||||
default:
|
||||
return state;
|
||||
|
||||
Reference in New Issue
Block a user