🔧 Fix for react-refresh plugin in production

This commit is contained in:
2022-06-14 13:04:29 -07:00
parent 7a3e0def34
commit a46eebb043
8 changed files with 233 additions and 12 deletions

View File

@@ -266,11 +266,11 @@ export const getTransfers =
true,
);
}
const transfers = await ADCPPSocket.get("queue/bundles/1/50", {});
if (!isNil(transfers)) {
const bundles = await ADCPPSocket.get("queue/bundles/1/50", {});
if (!isNil(bundles)) {
dispatch({
type: AIRDCPP_TRANSFERS_FETCHED,
transfers,
bundles,
});
}
} catch (err) {

View File

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

View File

@@ -3,6 +3,7 @@ import { getTransfers } from "../../actions/airdcpp.actions";
import { useDispatch, useSelector } from "react-redux";
import { AirDCPPSocketContext } from "../../context/AirDCPPSocket";
import { isEmpty, isUndefined } from "lodash";
import { searchIssue } from "../../actions/fileops.actions";
interface IDownloadsProps {
data: any;
@@ -16,6 +17,22 @@ export const Downloads = (props: IDownloadsProps): ReactElement => {
const AirDCPPTransfers = useSelector(
(state: RootState) => state.airdcpp.transfers,
);
useEffect(() => {
dispatch(
searchIssue(
{
query: {},
},
{
pagination: {
size: 25,
from: 0,
},
type: "wanted",
},
),
);
}, []);
// Make the call to get all transfers from AirDC++
useEffect(() => {
if (!isUndefined(AirDCPPSocket) && !isEmpty(airDCPPConfiguration)) {

View File

@@ -8,6 +8,7 @@ import App from "./components/App";
const rootEl = document.getElementById("root");
const root = createRoot(rootEl);
//In the entry of your indirect code path (e.g. some index.js), add the following two lines:
root.render(
<Provider store={store}>

View File

@@ -86,7 +86,7 @@ function airdcppReducer(state = initialState, action) {
case AIRDCPP_TRANSFERS_FETCHED:
return {
...state,
transfers: action.transfers,
transfers: action.bundles,
};
case LOCATION_CHANGE:
return {