Skip to content

Commit 2d67834

Browse files
authored
Merge pull request #6565 from Martchus/avoid-fetch-error
Avoid showing AJAX error on index page when user is navigating elsewhere
2 parents 4e4d9d0 + e3e36dc commit 2d67834

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

assets/javascripts/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
window.onbeforeunload = function () {
2+
window.unloading = true;
3+
};
4+
15
function setupIndexPage() {
26
setupFilterForm({preventLoadingIndication: true});
37

@@ -105,6 +109,9 @@ function loadBuildResults(queryParams) {
105109
window.buildResultStatus = 'success';
106110
})
107111
.catch(error => {
112+
if (window.unloading) {
113+
return;
114+
}
108115
const message = error ? htmlEscape(error) : 'Unable to fetch build results.';
109116
showBuildResults(
110117
'<div class="alert alert-danger" role="alert">' +

0 commit comments

Comments
 (0)