Fixed: handle race condition when updating share access rights in Edit User

This commit is contained in:
bergware
2019-12-26 16:33:30 +01:00
parent bc88bc88d4
commit bd1f9c86dc
+2 -2
View File
@@ -192,7 +192,7 @@ function updateAccess(form,data,n,i) {
var name = ",<?=$name?>,";
if (data) {
if (n<i) {
$.post('/update.htm',data[n], function(){setTimeout(function(){updateAccess(form,data,++n,i);},1000);});
$.post('/update.htm',data[n], function(){setTimeout(function(){updateAccess(form,data,++n,i);},3000);});
} else {
$('div.spinner').html(unraid_logo).hide();
$('input[value="Reset"]').val('Done').prop('disabled',false).prop('onclick',null).off('click').click(function(){done('UserEdit');});
@@ -205,6 +205,7 @@ function updateAccess(form,data,n,i) {
var share = decodeURI($(this).prop('id'));
var access = '';
data[i] = {};
data[i]['shareName'] = share;
data[i]['userAccess.0'] = '<?=$no?>';
for (var user in users) {
var idx = users[user];
@@ -223,7 +224,6 @@ function updateAccess(form,data,n,i) {
}
data[i]['userAccess.'+idx] = access;
}
data[i]['shareName'] = share;
data[i]['changeShareAccess'] = 'Apply';
i++;
}