summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorluckydonald <luckydonald@flutterb.at>2014-08-13 13:18:24 +0200
committerluckydonald <luckydonald@flutterb.at>2014-08-13 13:18:24 +0200
commitdf72723fb9276ca66584dee72e19092df1655bf5 (patch)
treeede0d072afc06ae3af9f0c40eb08bbc678fd3813 /apps/files
parent69d88500d32cd7a641061fbed420369a4eae3116 (diff)
downloadnextcloud-server-df72723fb9276ca66584dee72e19092df1655bf5.tar.gz
nextcloud-server-df72723fb9276ca66584dee72e19092df1655bf5.zip
Fixed "Any minute now" staying because of undefined buffer. Also increased buffer size to 20 to be less jittery.
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/js/file-upload.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index 874e88ef1cb..b43175da9a6 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -444,10 +444,13 @@ OC.Upload = {
//remaining time
var lastUpdate = new Date().getMilliseconds();
var lastSize = 0;
- var bufferSize = 10;
- var buffer = new Array();// = new Array(bufferSize);
+ var bufferSize = 20;
+ var buffer = new Array();
var bufferIndex = 0;
var bufferTotal = 0;
+ for(var i = 0; i < bufferSize;i++){
+ buffer[i] = 0;
+ }
// add progress handlers
fileupload.on('fileuploadadd', function(e, data) {
OC.Upload.log('progress handle fileuploadadd', e, data);
@@ -481,7 +484,7 @@ OC.Upload = {
diffSize = diffSize / diffUpdate; // apply timing factor, eg. 1mb/2s = 0.5mb/s
var remainingSeconds = ((data.total - data.loaded) / diffSize);
if(remainingSeconds>0){ //buffer to make it smoother
- bufferTotal = bufferTotal - (buffer[bufferIndex]||0) + remainingSeconds;
+ bufferTotal = bufferTotal - (buffer[bufferIndex]) + remainingSeconds;
buffer[bufferIndex] = remainingSeconds;
bufferIndex = (bufferIndex + 1) % bufferSize;
}