cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sgreb...@apache.org
Subject cordova-plugin-file-transfer git commit: CB-8590 (Windows) Fixed download.onprogress.lengthComputable
Date Thu, 05 Mar 2015 09:25:32 GMT
Repository: cordova-plugin-file-transfer
Updated Branches:
  refs/heads/master dc2161be2 -> 3ff838292


CB-8590 (Windows) Fixed download.onprogress.lengthComputable

github close #67


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/commit/3ff83829
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/3ff83829
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/3ff83829

Branch: refs/heads/master
Commit: 3ff8382929c35aa3a8d8a0d507ae5a01fb714834
Parents: dc2161b
Author: alsorokin <alexander.sorokin@akvelon.com>
Authored: Thu Mar 5 10:56:42 2015 +0300
Committer: sgrebnov <v-segreb@microsoft.com>
Committed: Thu Mar 5 12:24:57 2015 +0300

----------------------------------------------------------------------
 src/windows/FileTransferProxy.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/3ff83829/src/windows/FileTransferProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/FileTransferProxy.js b/src/windows/FileTransferProxy.js
index 3d299ef..659e5c9 100644
--- a/src/windows/FileTransferProxy.js
+++ b/src/windows/FileTransferProxy.js
@@ -361,7 +361,9 @@ exec(win, fail, 'FileTransfer', 'upload',
                         total: evt.progress.totalBytesToReceive,
                         target: evt.resultFile
                     });
-                    progressEvent.lengthComputable = true;
+                    // when bytesReceived == 0, BackgroundDownloader has not yet differentiated
whether it could get file length or not,
+                    // when totalBytesToReceive == 0, BackgroundDownloader is unable to get
file length
+                    progressEvent.lengthComputable = (evt.progress.bytesReceived > 0)
&& (evt.progress.totalBytesToReceive > 0);
 
                     successCallback(progressEvent, { keepCallback: true });
                 });


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message