Skip to content

Commit 932d69e

Browse files
author
Vikas Agarwal
committed
Removing unsaved alert as discussed here #1037 (comment)
1 parent 10c302a commit 932d69e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/projects/create/containers/CreateContainer.jsx

Lines changed: 8 additions & 4 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
}
@@ -111,9 +112,12 @@ class CreateConainer extends React.Component {
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)