0
0
Fork 0

Add confirmation modal when closing media edit modal with unsaved changes (#16518)

* Add confirmation modal when closing media edit modal with unsaved changes

* Move focal point media state to redux so it does not get erased by confirmation dialog

* Change upload modal behavior to keep it open while saving changes

Instead of closing it immediately and losing changes if they fail to save…

* Make it work with react-intl 2.9
This commit is contained in:
Claire 2021-07-25 01:14:43 +02:00 committed by GitHub
parent af08229ff4
commit a8a7066e97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 142 additions and 69 deletions

View file

@ -1,7 +1,6 @@
import { connect } from 'react-redux';
import Upload from '../components/upload';
import { undoUploadCompose } from '../../../actions/compose';
import { openModal } from '../../../actions/modal';
import { undoUploadCompose, initMediaEditModal } from '../../../actions/compose';
import { submitCompose } from '../../../actions/compose';
const mapStateToProps = (state, { id }) => ({
@ -15,7 +14,7 @@ const mapDispatchToProps = dispatch => ({
},
onOpenFocalPoint: id => {
dispatch(openModal('FOCAL_POINT', { id }));
dispatch(initMediaEditModal(id));
},
onSubmit (router) {