Fixed quota update on upload and on delete
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
62d71158a9
commit
ab1985b62b
|
@ -1803,7 +1803,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
updateStorageQuotas: function() {
|
updateStorageQuotas: function() {
|
||||||
OCA.Files.Files.updateStorageQuotas(this.getCurrentDirectory());
|
OCA.Files.Files.updateStorageQuotas();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2636,6 +2636,7 @@
|
||||||
self.updateSelectionSummary();
|
self.updateSelectionSummary();
|
||||||
// FIXME: don't repeat this, do it once all files are done
|
// FIXME: don't repeat this, do it once all files are done
|
||||||
self.updateStorageStatistics();
|
self.updateStorageStatistics();
|
||||||
|
self.updateStorageQuotas();
|
||||||
}
|
}
|
||||||
|
|
||||||
_.each(files, function(file) {
|
_.each(files, function(file) {
|
||||||
|
|
|
@ -29,23 +29,12 @@
|
||||||
state.dir = null;
|
state.dir = null;
|
||||||
state.call = null;
|
state.call = null;
|
||||||
Files.updateMaxUploadFilesize(response);
|
Files.updateMaxUploadFilesize(response);
|
||||||
Files.updateQuota(response);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// update quota
|
// update quota
|
||||||
updateStorageQuotas: function(currentDir) {
|
updateStorageQuotas: function() {
|
||||||
var state = Files.updateStorageStatistics;
|
var state = Files.updateStorageQuotas;
|
||||||
if (state.dir){
|
state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php'),function(response) {
|
||||||
if (state.dir === currentDir) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// cancel previous call, as it was for another dir
|
|
||||||
state.call.abort();
|
|
||||||
}
|
|
||||||
state.dir = currentDir;
|
|
||||||
state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php') + '?dir=' + encodeURIComponent(currentDir),function(response) {
|
|
||||||
state.dir = null;
|
|
||||||
state.call = null;
|
|
||||||
Files.updateQuota(response);
|
Files.updateQuota(response);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -70,6 +59,7 @@
|
||||||
else {
|
else {
|
||||||
Files._updateStorageStatisticsDebounced(dir);
|
Files._updateStorageStatisticsDebounced(dir);
|
||||||
}
|
}
|
||||||
|
//Files.updateStorageQuotas();
|
||||||
},
|
},
|
||||||
|
|
||||||
updateMaxUploadFilesize:function(response) {
|
updateMaxUploadFilesize:function(response) {
|
||||||
|
|
Loading…
Reference in New Issue