Add workaround for issue with "back" button in Safari

This commit is contained in:
Raphael Michel
2021-07-15 18:38:16 +02:00
parent a743605bd3
commit dcf29ec63e

View File

@@ -228,6 +228,17 @@ $(function () {
}
);
});
window.addEventListener("pageshow", function (evt) {
// In Safari, if you submit an async task, then get redirected, then go back,
// Safari won't reload the HTML from disk cache but instead reuse the DOM of the
// previous request, thus not clearing the "loading" state.
if (evt.persisted && $("body").hasClass("loading")) {
setTimeout(function () {
window.location.reload();
}, 10);
}
}, false);
});
var waitingDialog = {