Merge pull request #7686 from nextcloud/fix-quota-update-3

Fixed quota update on upload and on delete
This commit is contained in:
Roeland Jago Douma 2018-01-04 08:32:36 +01:00 committed by GitHub
commit 493c255f7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 15 deletions

View File

@ -1803,7 +1803,7 @@
},
updateStorageQuotas: function() {
OCA.Files.Files.updateStorageQuotas(this.getCurrentDirectory());
OCA.Files.Files.updateStorageQuotas();
},
/**
@ -2636,6 +2636,7 @@
self.updateSelectionSummary();
// FIXME: don't repeat this, do it once all files are done
self.updateStorageStatistics();
self.updateStorageQuotas();
}
_.each(files, function(file) {

View File

@ -29,23 +29,12 @@
state.dir = null;
state.call = null;
Files.updateMaxUploadFilesize(response);
Files.updateQuota(response);
});
},
// update quota
updateStorageQuotas: function(currentDir) {
var state = Files.updateStorageStatistics;
if (state.dir){
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;
updateStorageQuotas: function() {
var state = Files.updateStorageQuotas;
state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php'),function(response) {
Files.updateQuota(response);
});
},