Skip to content

Commit 7b4520f

Browse files
BFoucherlenybernard
authored andcommitted
fix firefox double reload :'( (#40)
* fix firefox double reload :'( * Update ajax.js
1 parent 84bbb61 commit 7b4520f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Resources/public/js/ajax.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,12 @@ function handleJson(json, update, updateStrategy, effect) {
227227
}
228228
// redirect is an url
229229
if (json.hasOwnProperty("redirect")) {
230+
// 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
230231
if (window.location == json.redirect) {
231232
location.reload(true);
233+
} else {
234+
window.location = json.redirect;
232235
}
233-
window.location = json.redirect;
234236
}
235237
}
236238

0 commit comments

Comments
 (0)