File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/projects/detail/components Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,6 @@ class EditProjectForm extends Component {
5050 isFeaturesDirty : false , // Since we just saved, features are not dirty anymore.
5151 canSubmit : false ,
5252 isSaving : false
53- } , ( ) => {
54- // Reset form
55- if ( this . refs . form && this . refs . form . isChanged ( ) ) this . refs . form . reset ( nextProps )
5653 } )
5754 }
5855
@@ -68,6 +65,16 @@ class EditProjectForm extends Component {
6865 // Notify user if they navigate away while the form is modified.
6966 onLeave ( e ) {
7067 if ( this . isChanged ( ) ) {
68+ // TODO: remove this block - it disables unsaved changes popup
69+ // for app screens changes
70+ if ( this . refs . form ) {
71+ const pristine = this . refs . form . getPristineValues ( )
72+ const current = this . refs . form . getCurrentValues ( )
73+ pristine [ 'details.appScreens.screens' ] = current [ 'details.appScreens.screens' ]
74+ if ( _ . isEqual ( pristine , current ) ) {
75+ return
76+ }
77+ }
7178 return e . returnValue = 'You have unsaved changes. Are you sure you want to leave?'
7279 }
7380 }
You can’t perform that action at this time.
0 commit comments