mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: Don't close Indexer add list when adding Indexers
This commit is contained in:
@@ -4,7 +4,7 @@ import Modal from 'Components/Modal/Modal';
|
|||||||
import AddIndexerModalContentConnector from './AddIndexerModalContentConnector';
|
import AddIndexerModalContentConnector from './AddIndexerModalContentConnector';
|
||||||
import styles from './AddIndexerModal.css';
|
import styles from './AddIndexerModal.css';
|
||||||
|
|
||||||
function AddIndexerModal({ isOpen, onModalClose, ...otherProps }) {
|
function AddIndexerModal({ isOpen, onModalClose, onSelectIndexer, ...otherProps }) {
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
@@ -14,6 +14,7 @@ function AddIndexerModal({ isOpen, onModalClose, ...otherProps }) {
|
|||||||
<AddIndexerModalContentConnector
|
<AddIndexerModalContentConnector
|
||||||
{...otherProps}
|
{...otherProps}
|
||||||
onModalClose={onModalClose}
|
onModalClose={onModalClose}
|
||||||
|
onSelectIndexer={onSelectIndexer}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
@@ -21,7 +22,8 @@ function AddIndexerModal({ isOpen, onModalClose, ...otherProps }) {
|
|||||||
|
|
||||||
AddIndexerModal.propTypes = {
|
AddIndexerModal.propTypes = {
|
||||||
isOpen: PropTypes.bool.isRequired,
|
isOpen: PropTypes.bool.isRequired,
|
||||||
onModalClose: PropTypes.func.isRequired
|
onModalClose: PropTypes.func.isRequired,
|
||||||
|
onSelectIndexer: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
export default AddIndexerModal;
|
export default AddIndexerModal;
|
||||||
|
@@ -51,7 +51,7 @@ class AddIndexerModalContentConnector extends Component {
|
|||||||
|
|
||||||
onIndexerSelect = ({ implementation, name }) => {
|
onIndexerSelect = ({ implementation, name }) => {
|
||||||
this.props.selectIndexerSchema({ implementation, name });
|
this.props.selectIndexerSchema({ implementation, name });
|
||||||
this.props.onModalClose({ indexerSelected: true });
|
this.props.onSelectIndexer();
|
||||||
};
|
};
|
||||||
|
|
||||||
onSortPress = (sortKey, sortDirection) => {
|
onSortPress = (sortKey, sortDirection) => {
|
||||||
@@ -76,7 +76,8 @@ AddIndexerModalContentConnector.propTypes = {
|
|||||||
fetchIndexerSchema: PropTypes.func.isRequired,
|
fetchIndexerSchema: PropTypes.func.isRequired,
|
||||||
selectIndexerSchema: PropTypes.func.isRequired,
|
selectIndexerSchema: PropTypes.func.isRequired,
|
||||||
setIndexerSchemaSort: PropTypes.func.isRequired,
|
setIndexerSchemaSort: PropTypes.func.isRequired,
|
||||||
onModalClose: PropTypes.func.isRequired
|
onModalClose: PropTypes.func.isRequired,
|
||||||
|
onSelectIndexer: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
export default connect(createMapStateToProps, mapDispatchToProps)(AddIndexerModalContentConnector);
|
export default connect(createMapStateToProps, mapDispatchToProps)(AddIndexerModalContentConnector);
|
||||||
|
@@ -193,11 +193,12 @@ class IndexerIndex extends Component {
|
|||||||
this.setState({ isAddIndexerModalOpen: true });
|
this.setState({ isAddIndexerModalOpen: true });
|
||||||
};
|
};
|
||||||
|
|
||||||
onAddIndexerModalClose = ({ indexerSelected = false } = {}) => {
|
onAddIndexerModalClose = () => {
|
||||||
this.setState({
|
this.setState({ isAddIndexerModalOpen: false });
|
||||||
isAddIndexerModalOpen: false,
|
};
|
||||||
isEditIndexerModalOpen: indexerSelected
|
|
||||||
});
|
onAddIndexerSelectIndexer = () => {
|
||||||
|
this.setState({ isEditIndexerModalOpen: true });
|
||||||
};
|
};
|
||||||
|
|
||||||
onEditIndexerModalClose = () => {
|
onEditIndexerModalClose = () => {
|
||||||
@@ -463,6 +464,7 @@ class IndexerIndex extends Component {
|
|||||||
<AddIndexerModal
|
<AddIndexerModal
|
||||||
isOpen={isAddIndexerModalOpen}
|
isOpen={isAddIndexerModalOpen}
|
||||||
onModalClose={this.onAddIndexerModalClose}
|
onModalClose={this.onAddIndexerModalClose}
|
||||||
|
onSelectIndexer={this.onAddIndexerSelectIndexer}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<EditIndexerModalConnector
|
<EditIndexerModalConnector
|
||||||
|
Reference in New Issue
Block a user