Skip to content
Snippets Groups Projects
Commit a438abe2 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #5699 from owncloud/fixing-4606-master

calling getstoragestats.php only if a user is logged in because this cal...
parents ad336c94 b869fb2a
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment