fix: Stop polling enhanced apps when api returns error
This commit is contained in:
parent
f9280cd4c0
commit
48616e87bd
4 changed files with 21 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -28,3 +28,4 @@ yarn-error.log
|
||||||
.VolumeIcon.icns
|
.VolumeIcon.icns
|
||||||
storage/app/public/avatars/*
|
storage/app/public/avatars/*
|
||||||
.env
|
.env
|
||||||
|
.phpunit.result.cache
|
||||||
|
|
13
public/js/app.js
vendored
13
public/js/app.js
vendored
|
@ -588,8 +588,13 @@ $.when($.ready).then(function () {
|
||||||
if (timer < max_timer) timer += 2000;
|
if (timer < max_timer) timer += 2000;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
complete: function complete() {
|
complete: function complete(jqXHR) {
|
||||||
// Schedule the next request when the current one's complete
|
if (jqXHR.status > 299) {
|
||||||
|
// Stop polling when we get errors
|
||||||
|
return;
|
||||||
|
} // Schedule the next request when the current one's complete
|
||||||
|
|
||||||
|
|
||||||
livestatsRefreshTimeouts[index] = window.setTimeout(worker, timer);
|
livestatsRefreshTimeouts[index] = window.setTimeout(worker, timer);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -696,10 +701,10 @@ $.when($.ready).then(function () {
|
||||||
$('.add-item').hide();
|
$('.add-item').hide();
|
||||||
$('.item-edit').hide();
|
$('.item-edit').hide();
|
||||||
$('#app').removeClass('sidebar');
|
$('#app').removeClass('sidebar');
|
||||||
$('#sortable .tooltip').css('display', '')
|
$('#sortable .tooltip').css('display', '');
|
||||||
$('#sortable').sortable('disable');
|
$('#sortable').sortable('disable');
|
||||||
} else {
|
} else {
|
||||||
$('#sortable .tooltip').css('display', 'none')
|
$('#sortable .tooltip').css('display', 'none');
|
||||||
$('#sortable').sortable('enable');
|
$('#sortable').sortable('enable');
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
$('.add-item').fadeIn();
|
$('.add-item').fadeIn();
|
||||||
|
|
2
public/mix-manifest.json
generated
2
public/mix-manifest.json
generated
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"/css/app.css": "/css/app.css?id=ad45b1705b7f7906db0b",
|
"/css/app.css": "/css/app.css?id=ad45b1705b7f7906db0b",
|
||||||
"/js/app.js": "/js/app.js?id=5446aeb4aa754e641c77"
|
"/js/app.js": "/js/app.js?id=19a3a77634861ef418d7"
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,12 @@ $.when( $.ready ).then(function() {
|
||||||
if(timer < max_timer) timer += 2000;
|
if(timer < max_timer) timer += 2000;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
complete: function() {
|
complete: function(jqXHR) {
|
||||||
|
if (jqXHR.status > 299) {
|
||||||
|
// Stop polling when we get errors
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Schedule the next request when the current one's complete
|
// Schedule the next request when the current one's complete
|
||||||
livestatsRefreshTimeouts[index] = window.setTimeout(worker, timer);
|
livestatsRefreshTimeouts[index] = window.setTimeout(worker, timer);
|
||||||
}
|
}
|
||||||
|
@ -128,7 +133,7 @@ $.when( $.ready ).then(function() {
|
||||||
});
|
});
|
||||||
$('#sortable').sortable('disable');
|
$('#sortable').sortable('disable');
|
||||||
|
|
||||||
$('#sortable').on('mouseenter', '.item', function () {
|
$('#main').on('mouseenter', '#sortable.ui-sortable-disabled .item', function () {
|
||||||
$(this).siblings('.tooltip').addClass('active')
|
$(this).siblings('.tooltip').addClass('active')
|
||||||
$('.refresh', this).addClass('active')
|
$('.refresh', this).addClass('active')
|
||||||
}).on('mouseleave', '.item', function () {
|
}).on('mouseleave', '.item', function () {
|
||||||
|
@ -181,8 +186,10 @@ $.when( $.ready ).then(function() {
|
||||||
$('.add-item').hide();
|
$('.add-item').hide();
|
||||||
$('.item-edit').hide();
|
$('.item-edit').hide();
|
||||||
$('#app').removeClass('sidebar');
|
$('#app').removeClass('sidebar');
|
||||||
|
$('#sortable .tooltip').css('display', '')
|
||||||
$('#sortable').sortable('disable');
|
$('#sortable').sortable('disable');
|
||||||
} else {
|
} else {
|
||||||
|
$('#sortable .tooltip').css('display', 'none')
|
||||||
$('#sortable').sortable('enable');
|
$('#sortable').sortable('enable');
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$('.add-item').fadeIn();
|
$('.add-item').fadeIn();
|
||||||
|
|
Loading…
Reference in a new issue