chore(navigate-away-prompt): merging two if conditions
This commit is contained in:
parent
49ac17f8e9
commit
a5e666d155
@ -107,13 +107,8 @@ export class NavigateAwayPrompt {
|
||||
// allow the event to happen if the form was not touched by the
|
||||
// user (i.e. if the current FormData is equal to the initial FormData)
|
||||
// or the unload event was initiated by a form submit
|
||||
if (!formDataHasChanged)
|
||||
if (!formDataHasChanged || this.unloadDueToSubmit)
|
||||
return;
|
||||
|
||||
|
||||
if(this._unloadDueToSubmit) {
|
||||
return;
|
||||
}
|
||||
|
||||
// cancel the unload event. This is the standard to force the prompt to appear.
|
||||
event.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user