diff --git a/src/js/Connection.js b/src/js/Connection.js index 245d663..c486bed 100644 --- a/src/js/Connection.js +++ b/src/js/Connection.js @@ -644,7 +644,7 @@ class Connection { // update file transfer progress fileTransfer.status = FileTransferrer.STATUS_SENDING; - fileTransfer.progress = Math.min(100, Math.ceil(requestFileChunk.offset + requestFileChunk.length / fileTransfer.filesize * 100)); + fileTransfer.progress = Math.min(100, Math.ceil((requestFileChunk.offset + requestFileChunk.length) / fileTransfer.filesize * 100)); // send file part await FileTransferrer.sendFileChunk(fileTransfer, requestFileChunk.offset, requestFileChunk.length); diff --git a/src/js/FileTransferrer.js b/src/js/FileTransferrer.js index 6cc90f1..4157293 100644 --- a/src/js/FileTransferrer.js +++ b/src/js/FileTransferrer.js @@ -105,7 +105,7 @@ class FileTransferrer { } // update file transfer progress - fileTransfer.progress = Math.min(100, Math.ceil(fileChunk.offset + fileChunk.length / fileTransfer.filesize * 100)); + fileTransfer.progress = Math.min(100, Math.ceil((fileChunk.offset + fileChunk.length) / fileTransfer.filesize * 100)); } catch(e) { this.log("failed to get file chunk", e);