Skip to content

Commit ed99787

Browse files
author
vikasrohit
authored
Merge pull request #1147 from appirio-tech/feature/misc-changes
Removing unsaved content alerts
2 parents 4033548 + 7e4587f commit ed99787

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/projects/create/containers/CreateContainer.jsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ class CreateConainer extends React.Component {
9393
}
9494
}
9595

96-
componentDidMount() {
96+
componentDidMount() {
9797
// sets route leave hook to show unsaved changes alert and persist incomplete project
9898
this.props.router.setRouteLeaveHook(this.props.route, this.onLeave)
99+
99100
// sets window unload hook to show unsaved changes alert and persist incomplete project
100101
window.addEventListener('beforeunload', this.onLeave)
101102
}
@@ -105,15 +106,18 @@ class CreateConainer extends React.Component {
105106
}
106107

107108
// stores the incomplete project in local storage
108-
onLeave(e) {
109-
const { wizardStep, isProjectDirty, creatingProject } = this.state
109+
onLeave(e) {// eslint-disable-line no-unused-vars
110+
const { wizardStep, isProjectDirty } = this.state
110111
if (wizardStep === ProjectWizard.Steps.WZ_STEP_FILL_PROJ_DETAILS && isProjectDirty) {// Project Details step
111112
console.log('saving incomplete project')
112113
window.localStorage.setItem(LS_INCOMPLETE_PROJECT, JSON.stringify(this.state.updatedProject))
113114
}
114-
if (isProjectDirty && !creatingProject) {
115-
return e.returnValue = 'You have unsaved changes. Are you sure you want to leave?'
116-
}
115+
// commenting alerts for the page unload and route change hooks as discussed
116+
// https://github.com/appirio-tech/connect-app/issues/1037#issuecomment-324732052
117+
118+
// if (isProjectDirty && !creatingProject) {
119+
// return e.returnValue = 'You have unsaved changes. Are you sure you want to leave?'
120+
// }
117121
}
118122

119123
/**

0 commit comments

Comments
 (0)