diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-01-03 13:59:36 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-01-03 13:59:36 +0100 |
commit | c4490c6ba890240777fc033b56f9bdd8fd4f4c9a (patch) | |
tree | fdf545037f0bb627589ccd34e5f433a7cf88770d /apps/files/js/files.js | |
parent | a8ab67ff48aa425edd1d86b4a3b5855150bb2ac1 (diff) | |
download | nextcloud-server-c4490c6ba890240777fc033b56f9bdd8fd4f4c9a.tar.gz nextcloud-server-c4490c6ba890240777fc033b56f9bdd8fd4f4c9a.zip |
Update quotas on each upload
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
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. |