mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-18 21:35:27 -04:00
Use react-query for Indexers
This commit is contained in:
@@ -6,8 +6,8 @@ import ConfirmModal from 'Components/Modal/ConfirmModal';
|
||||
import TagList from 'Components/TagList';
|
||||
import useModalOpenState from 'Helpers/Hooks/useModalOpenState';
|
||||
import { kinds } from 'Helpers/Props';
|
||||
import { IndexerModel } from 'Settings/Indexers/useIndexers';
|
||||
import { Tag } from 'Tags/useTags';
|
||||
import Indexer from 'typings/Indexer';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import EditReleaseProfileModal from './EditReleaseProfileModal';
|
||||
import {
|
||||
@@ -18,7 +18,7 @@ import styles from './ReleaseProfileItem.css';
|
||||
|
||||
interface ReleaseProfileProps extends ReleaseProfileModel {
|
||||
tagList: Tag[];
|
||||
indexerList: Indexer[];
|
||||
indexerList: IndexerModel[];
|
||||
}
|
||||
|
||||
function ReleaseProfileItem(props: ReleaseProfileProps) {
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import AppState from 'App/State/AppState';
|
||||
import React from 'react';
|
||||
import Card from 'Components/Card';
|
||||
import FieldSet from 'Components/FieldSet';
|
||||
import Icon from 'Components/Icon';
|
||||
import PageSectionContent from 'Components/Page/PageSectionContent';
|
||||
import useModalOpenState from 'Helpers/Hooks/useModalOpenState';
|
||||
import { icons } from 'Helpers/Props';
|
||||
import { fetchIndexers } from 'Store/Actions/settingsActions';
|
||||
import { useIndexersData } from 'Settings/Indexers/useIndexers';
|
||||
import { useTagList } from 'Tags/useTags';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import EditReleaseProfileModal from './EditReleaseProfileModal';
|
||||
@@ -16,13 +14,10 @@ import { useReleaseProfiles } from './useReleaseProfiles';
|
||||
import styles from './ReleaseProfiles.css';
|
||||
|
||||
function ReleaseProfiles() {
|
||||
const dispatch = useDispatch();
|
||||
const { data, isFetching, isFetched, error } = useReleaseProfiles();
|
||||
|
||||
const tagList = useTagList();
|
||||
const indexerList = useSelector(
|
||||
(state: AppState) => state.settings.indexers.items
|
||||
);
|
||||
const indexerList = useIndexersData();
|
||||
|
||||
const [
|
||||
isAddReleaseProfileModalOpen,
|
||||
@@ -30,10 +25,6 @@ function ReleaseProfiles() {
|
||||
setAddReleaseProfileModalClosed,
|
||||
] = useModalOpenState(false);
|
||||
|
||||
useEffect(() => {
|
||||
dispatch(fetchIndexers());
|
||||
}, [dispatch]);
|
||||
|
||||
return (
|
||||
<FieldSet legend={translate('ReleaseProfiles')}>
|
||||
<PageSectionContent
|
||||
|
||||
Reference in New Issue
Block a user