From 7b4520f202f7dd7c32b737ab96d070f332617fd1 Mon Sep 17 00:00:00 2001 From: Baptiste Foucher Date: Mon, 7 Aug 2017 16:24:58 +0200 Subject: [PATCH] fix firefox double reload :'( (#40) * fix firefox double reload :'( * Update ajax.js --- Resources/public/js/ajax.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Resources/public/js/ajax.js b/Resources/public/js/ajax.js index ed01ba9..78b5ed0 100644 --- a/Resources/public/js/ajax.js +++ b/Resources/public/js/ajax.js @@ -227,10 +227,12 @@ function handleJson(json, update, updateStrategy, effect) { } // redirect is an url if (json.hasOwnProperty("redirect")) { + // On firefox location.reload and window.location do not stop the execution of the script. We need to run only 1 command to avoid a double redirection if (window.location == json.redirect) { location.reload(true); + } else { + window.location = json.redirect; } - window.location = json.redirect; } }