diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-01-03 16:30:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-03 16:30:19 +0100 |
commit | 0bc6a7d7fd98b0d8298d173ff3740684551aebef (patch) | |
tree | 32bdaaa2b78a7adf4e17a9c4b672e1f76916cbec /apps/files/js/files.js | |
parent | 876238ce8ba2a9b3c65e53f88806db8e665d6248 (diff) | |
parent | 51eb26e18379a2ba3f90c719048fc2d3986f3190 (diff) | |
download | nextcloud-server-0bc6a7d7fd98b0d8298d173ff3740684551aebef.tar.gz nextcloud-server-0bc6a7d7fd98b0d8298d173ff3740684551aebef.zip |
Merge pull request #7681 from nextcloud/fix-quota-update-2
Update quotas on each upload
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r-- | apps/files/js/files.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index a1e59015b1d..5e34f664a6c 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -32,6 +32,23 @@ 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; + Files.updateQuota(response); + }); + }, /** * Update storage statistics such as free space, max upload, * etc based on the given directory. |