mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 13:10:13 -07:00
New: Closing Move Artists modal without selecting will cancel save
(cherry picked from commit cb86f4fa50fd4755ad90a858fe70a229a7ca2975)
This commit is contained in:
parent
fae94f4b8e
commit
de6c9589d0
3 changed files with 14 additions and 2 deletions
|
@ -35,6 +35,10 @@ class EditArtistModalContent extends Component {
|
||||||
//
|
//
|
||||||
// Listeners
|
// Listeners
|
||||||
|
|
||||||
|
onCancelPress = () => {
|
||||||
|
this.setState({ isConfirmMoveModalOpen: false });
|
||||||
|
};
|
||||||
|
|
||||||
onSavePress = () => {
|
onSavePress = () => {
|
||||||
const {
|
const {
|
||||||
isPathChanging,
|
isPathChanging,
|
||||||
|
@ -226,6 +230,7 @@ class EditArtistModalContent extends Component {
|
||||||
originalPath={originalPath}
|
originalPath={originalPath}
|
||||||
destinationPath={path.value}
|
destinationPath={path.value}
|
||||||
isOpen={this.state.isConfirmMoveModalOpen}
|
isOpen={this.state.isConfirmMoveModalOpen}
|
||||||
|
onModalClose={this.onCancelPress}
|
||||||
onSavePress={this.onSavePress}
|
onSavePress={this.onSavePress}
|
||||||
onMoveArtistPress={this.onMoveArtistPress}
|
onMoveArtistPress={this.onMoveArtistPress}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -135,6 +135,10 @@ function EditArtistModalContent(props: EditArtistModalContentProps) {
|
||||||
}
|
}
|
||||||
}, [rootFolderPath, save]);
|
}, [rootFolderPath, save]);
|
||||||
|
|
||||||
|
const onCancelPress = useCallback(() => {
|
||||||
|
setIsConfirmMoveModalOpen(false);
|
||||||
|
}, [setIsConfirmMoveModalOpen]);
|
||||||
|
|
||||||
const onDoNotMoveArtistPress = useCallback(() => {
|
const onDoNotMoveArtistPress = useCallback(() => {
|
||||||
setIsConfirmMoveModalOpen(false);
|
setIsConfirmMoveModalOpen(false);
|
||||||
save(false);
|
save(false);
|
||||||
|
@ -223,6 +227,7 @@ function EditArtistModalContent(props: EditArtistModalContentProps) {
|
||||||
<MoveArtistModal
|
<MoveArtistModal
|
||||||
isOpen={isConfirmMoveModalOpen}
|
isOpen={isConfirmMoveModalOpen}
|
||||||
destinationRootFolder={rootFolderPath}
|
destinationRootFolder={rootFolderPath}
|
||||||
|
onModalClose={onCancelPress}
|
||||||
onSavePress={onDoNotMoveArtistPress}
|
onSavePress={onDoNotMoveArtistPress}
|
||||||
onMoveArtistPress={onMoveArtistPress}
|
onMoveArtistPress={onMoveArtistPress}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -15,6 +15,7 @@ function MoveArtistModal(props) {
|
||||||
destinationPath,
|
destinationPath,
|
||||||
destinationRootFolder,
|
destinationRootFolder,
|
||||||
isOpen,
|
isOpen,
|
||||||
|
onModalClose,
|
||||||
onSavePress,
|
onSavePress,
|
||||||
onMoveArtistPress
|
onMoveArtistPress
|
||||||
} = props;
|
} = props;
|
||||||
|
@ -33,11 +34,11 @@ function MoveArtistModal(props) {
|
||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
size={sizes.MEDIUM}
|
size={sizes.MEDIUM}
|
||||||
closeOnBackgroundClick={false}
|
closeOnBackgroundClick={false}
|
||||||
onModalClose={onSavePress}
|
onModalClose={onModalClose}
|
||||||
>
|
>
|
||||||
<ModalContent
|
<ModalContent
|
||||||
showCloseButton={true}
|
showCloseButton={true}
|
||||||
onModalClose={onSavePress}
|
onModalClose={onModalClose}
|
||||||
>
|
>
|
||||||
<ModalHeader>
|
<ModalHeader>
|
||||||
Move Files
|
Move Files
|
||||||
|
@ -76,6 +77,7 @@ MoveArtistModal.propTypes = {
|
||||||
destinationPath: PropTypes.string,
|
destinationPath: PropTypes.string,
|
||||||
destinationRootFolder: PropTypes.string,
|
destinationRootFolder: PropTypes.string,
|
||||||
isOpen: PropTypes.bool.isRequired,
|
isOpen: PropTypes.bool.isRequired,
|
||||||
|
onModalClose: PropTypes.func.isRequired,
|
||||||
onSavePress: PropTypes.func.isRequired,
|
onSavePress: PropTypes.func.isRequired,
|
||||||
onMoveArtistPress: PropTypes.func.isRequired
|
onMoveArtistPress: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue