mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
Misc Frontend Updates
This commit is contained in:
+8
-6
@@ -6,17 +6,19 @@ import { cancelTestDownloadClient, cancelSaveDownloadClient } from 'Store/Action
|
||||
import EditDownloadClientModal from './EditDownloadClientModal';
|
||||
|
||||
function createMapDispatchToProps(dispatch, props) {
|
||||
const section = 'downloadClients';
|
||||
|
||||
return {
|
||||
dispatchClearPendingChanges() {
|
||||
dispatch(clearPendingChanges);
|
||||
dispatch(clearPendingChanges({ section }));
|
||||
},
|
||||
|
||||
dispatchCancelTestDownloadClient() {
|
||||
dispatch(cancelTestDownloadClient);
|
||||
dispatch(cancelTestDownloadClient({ section }));
|
||||
},
|
||||
|
||||
dispatchCancelSaveDownloadClient() {
|
||||
dispatch(cancelSaveDownloadClient);
|
||||
dispatch(cancelSaveDownloadClient({ section }));
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -27,9 +29,9 @@ class EditDownloadClientModalConnector extends Component {
|
||||
// Listeners
|
||||
|
||||
onModalClose = () => {
|
||||
this.props.dispatchClearPendingChanges({ section: 'downloadClients' });
|
||||
this.props.dispatchCancelTestDownloadClient({ section: 'downloadClients' });
|
||||
this.props.dispatchCancelSaveDownloadClient({ section: 'downloadClients' });
|
||||
this.props.dispatchClearPendingChanges();
|
||||
this.props.dispatchCancelTestDownloadClient();
|
||||
this.props.dispatchCancelSaveDownloadClient();
|
||||
this.props.onModalClose();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,17 +6,19 @@ import { cancelTestIndexer, cancelSaveIndexer } from 'Store/Actions/settingsActi
|
||||
import EditIndexerModal from './EditIndexerModal';
|
||||
|
||||
function createMapDispatchToProps(dispatch, props) {
|
||||
const section = 'indexers';
|
||||
|
||||
return {
|
||||
dispatchClearPendingChanges() {
|
||||
dispatch(clearPendingChanges);
|
||||
dispatch(clearPendingChanges)({ section });
|
||||
},
|
||||
|
||||
dispatchCancelTestIndexer() {
|
||||
dispatch(cancelTestIndexer);
|
||||
dispatch(cancelTestIndexer({ section }));
|
||||
},
|
||||
|
||||
dispatchCancelSaveIndexer() {
|
||||
dispatch(cancelSaveIndexer);
|
||||
dispatch(cancelSaveIndexer({ section }));
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -27,9 +29,9 @@ class EditIndexerModalConnector extends Component {
|
||||
// Listeners
|
||||
|
||||
onModalClose = () => {
|
||||
this.props.dispatchClearPendingChanges({ section: 'indexers' });
|
||||
this.props.dispatchCancelTestIndexer({ section: 'indexers' });
|
||||
this.props.dispatchCancelSaveIndexer({ section: 'indexers' });
|
||||
this.props.dispatchClearPendingChanges();
|
||||
this.props.dispatchCancelTestIndexer();
|
||||
this.props.dispatchCancelSaveIndexer();
|
||||
this.props.onModalClose();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,15 @@ import { connect } from 'react-redux';
|
||||
import { clearPendingChanges } from 'Store/Actions/baseActions';
|
||||
import EditMetadataModal from './EditMetadataModal';
|
||||
|
||||
const mapDispatchToProps = {
|
||||
clearPendingChanges
|
||||
};
|
||||
function createMapDispatchToProps(dispatch, props) {
|
||||
const section = 'metadata';
|
||||
|
||||
return {
|
||||
dispatchClearPendingChanges() {
|
||||
dispatch(clearPendingChanges)({ section });
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
class EditMetadataModalConnector extends Component {
|
||||
|
||||
@@ -36,4 +42,4 @@ EditMetadataModalConnector.propTypes = {
|
||||
clearPendingChanges: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default connect(null, mapDispatchToProps)(EditMetadataModalConnector);
|
||||
export default connect(null, createMapDispatchToProps)(EditMetadataModalConnector);
|
||||
|
||||
+33
-7
@@ -2,11 +2,26 @@ import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { clearPendingChanges } from 'Store/Actions/baseActions';
|
||||
import { cancelTestNotification, cancelSaveNotification } from 'Store/Actions/settingsActions';
|
||||
import EditNotificationModal from './EditNotificationModal';
|
||||
|
||||
const mapDispatchToProps = {
|
||||
clearPendingChanges
|
||||
};
|
||||
function createMapDispatchToProps(dispatch, props) {
|
||||
const section = 'notifications';
|
||||
|
||||
return {
|
||||
dispatchClearPendingChanges() {
|
||||
dispatch(clearPendingChanges({ section }));
|
||||
},
|
||||
|
||||
dispatchCancelTestNotification() {
|
||||
dispatch(cancelTestNotification({ section }));
|
||||
},
|
||||
|
||||
dispatchCancelSaveNotification() {
|
||||
dispatch(cancelSaveNotification({ section }));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
class EditNotificationModalConnector extends Component {
|
||||
|
||||
@@ -14,7 +29,9 @@ class EditNotificationModalConnector extends Component {
|
||||
// Listeners
|
||||
|
||||
onModalClose = () => {
|
||||
this.props.clearPendingChanges({ section: 'notifications' });
|
||||
this.props.dispatchClearPendingChanges();
|
||||
this.props.dispatchCancelTestNotification();
|
||||
this.props.dispatchCancelSaveNotification();
|
||||
this.props.onModalClose();
|
||||
}
|
||||
|
||||
@@ -22,9 +39,16 @@ class EditNotificationModalConnector extends Component {
|
||||
// Render
|
||||
|
||||
render() {
|
||||
const {
|
||||
dispatchClearPendingChanges,
|
||||
dispatchCancelTestNotification,
|
||||
dispatchCancelSaveNotification,
|
||||
...otherProps
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
<EditNotificationModal
|
||||
{...this.props}
|
||||
{...otherProps}
|
||||
onModalClose={this.onModalClose}
|
||||
/>
|
||||
);
|
||||
@@ -33,7 +57,9 @@ class EditNotificationModalConnector extends Component {
|
||||
|
||||
EditNotificationModalConnector.propTypes = {
|
||||
onModalClose: PropTypes.func.isRequired,
|
||||
clearPendingChanges: PropTypes.func.isRequired
|
||||
dispatchClearPendingChanges: PropTypes.func.isRequired,
|
||||
dispatchCancelTestNotification: PropTypes.func.isRequired,
|
||||
dispatchCancelSaveNotification: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default connect(null, mapDispatchToProps)(EditNotificationModalConnector);
|
||||
export default connect(null, createMapDispatchToProps)(EditNotificationModalConnector);
|
||||
|
||||
Reference in New Issue
Block a user