New: Closing Move Movie modal without selecting will cancel save

Closes #8225

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
pull/8424/head
Qstick 2 years ago
parent 80d7bdb834
commit a41999f9c2

@ -31,6 +31,10 @@ class EditMovieModalContent extends Component {
//
// Listeners
onCancelPress = () => {
this.setState({ isConfirmMoveModalOpen: false });
};
onSavePress = () => {
const {
isPathChanging,
@ -171,6 +175,7 @@ class EditMovieModalContent extends Component {
originalPath={originalPath}
destinationPath={path.value}
isOpen={this.state.isConfirmMoveModalOpen}
onModalClose={this.onCancelPress}
onSavePress={this.onSavePress}
onMoveMoviePress={this.onMoveMoviePress}
/>

@ -100,6 +100,10 @@ function EditMoviesModalContent(props: EditMoviesModalContentProps) {
}
}, [rootFolderPath, save]);
const onCancelPress = useCallback(() => {
setIsConfirmMoveModalOpen(false);
}, [setIsConfirmMoveModalOpen]);
const onDoNotMoveMoviePress = useCallback(() => {
setIsConfirmMoveModalOpen(false);
save(false);
@ -177,6 +181,7 @@ function EditMoviesModalContent(props: EditMoviesModalContentProps) {
<MoveMovieModal
isOpen={isConfirmMoveModalOpen}
destinationRootFolder={rootFolderPath}
onModalClose={onCancelPress}
onSavePress={onDoNotMoveMoviePress}
onMoveMoviePress={onMoveMoviePress}
/>

@ -16,6 +16,7 @@ function MoveMovieModal(props) {
destinationPath,
destinationRootFolder,
isOpen,
onModalClose,
onSavePress,
onMoveMoviePress
} = props;
@ -34,11 +35,11 @@ function MoveMovieModal(props) {
isOpen={isOpen}
size={sizes.MEDIUM}
closeOnBackgroundClick={false}
onModalClose={onSavePress}
onModalClose={onModalClose}
>
<ModalContent
showCloseButton={true}
onModalClose={onSavePress}
onModalClose={onModalClose}
>
<ModalHeader>
{translate('MoveFiles')}
@ -84,6 +85,7 @@ MoveMovieModal.propTypes = {
destinationPath: PropTypes.string,
destinationRootFolder: PropTypes.string,
isOpen: PropTypes.bool.isRequired,
onModalClose: PropTypes.func.isRequired,
onSavePress: PropTypes.func.isRequired,
onMoveMoviePress: PropTypes.func.isRequired
};

Loading…
Cancel
Save