From a5e666d155e6f9c998f3fb4fadf97d01e68f2b45 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Tue, 24 Aug 2021 10:40:51 +0200 Subject: [PATCH] chore(navigate-away-prompt): merging two if conditions --- frontend/src/utils/form/navigate-away-prompt.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/frontend/src/utils/form/navigate-away-prompt.js b/frontend/src/utils/form/navigate-away-prompt.js index bb05238aa..da900ba72 100644 --- a/frontend/src/utils/form/navigate-away-prompt.js +++ b/frontend/src/utils/form/navigate-away-prompt.js @@ -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();