Skip to content

Commit

Permalink
fix transfer progress
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcottle committed Dec 17, 2024
1 parent ded5b56 commit 67a270c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/js/Connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/js/FileTransferrer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 67a270c

Please sign in to comment.