summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-11-05 12:18:25 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2013-11-05 12:18:25 +0100
commitb869fb2a0961e5cb5a6233626721b14f5e1cfdd8 (patch)
tree85d356de3a3c8348963f7bf9fa101886f1028be3 /apps/files/js
parent3488202f6728261f6d140f62353ea405f2680452 (diff)
downloadnextcloud-server-b869fb2a0961e5cb5a6233626721b14f5e1cfdd8.tar.gz
nextcloud-server-b869fb2a0961e5cb5a6233626721b14f5e1cfdd8.zip
calling getstoragestats.php only if a user is logged in because this call requires a user to be logged in
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/files.js36
1 files changed, 19 insertions, 17 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 5fa2b128153..eb30ddfda0f 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -357,24 +357,26 @@ $(document).ready(function() {
Files.updateMaxUploadFilesize(response);
});
}
-
- // start on load - we ask the server every 5 minutes
- var update_storage_statistics_interval = 5*60*1000;
- var update_storage_statistics_interval_id = setInterval(update_storage_statistics, update_storage_statistics_interval);
-
- // Use jquery-visibility to de-/re-activate file stats sync
- if ($.support.pageVisibility) {
- $(document).on({
- 'show.visibility': function() {
- if (!update_storage_statistics_interval_id) {
- update_storage_statistics_interval_id = setInterval(update_storage_statistics, update_storage_statistics_interval);
+ // only possible at the moment if user is logged in
+ if (OC.currentUser) {
+ // start on load - we ask the server every 5 minutes
+ var update_storage_statistics_interval = 5*60*1000;
+ var update_storage_statistics_interval_id = setInterval(update_storage_statistics, update_storage_statistics_interval);
+
+ // Use jquery-visibility to de-/re-activate file stats sync
+ if ($.support.pageVisibility) {
+ $(document).on({
+ 'show.visibility': function() {
+ if (!update_storage_statistics_interval_id) {
+ update_storage_statistics_interval_id = setInterval(update_storage_statistics, update_storage_statistics_interval);
+ }
+ },
+ 'hide.visibility': function() {
+ clearInterval(update_storage_statistics_interval_id);
+ update_storage_statistics_interval_id = 0;
}
- },
- 'hide.visibility': function() {
- clearInterval(update_storage_statistics_interval_id);
- update_storage_statistics_interval_id = 0;
- }
- });
+ });
+ }
}
//scroll to and highlight preselected file