Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update apps/files/js/file-upload.js
Code Style

Co-authored-by: Carl Schwan <[email protected]>
  • Loading branch information
Phlogi and CarlSchwan authored Dec 8, 2021
commit b0a57ccfb8bff2dc46d4d52ae3d0e772d0648284
2 changes: 1 addition & 1 deletion apps/files/js/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ OC.Uploader.prototype = _.extend({
smoothRemainingSeconds = smoothing * (bufferTotal / bufferSize) + ((1-smoothing) * smoothRemainingSeconds);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smoothRemainingSeconds value depends on itself, this leads to NaN when I test it.

Copy link
Contributor

@artonge artonge Apr 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe update the above condition to smoothRemainingSeconds === undefined

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should check for undefined.
if (smoothRemainingSeconds === undefined){

Same for the bitrate:

if (smoothBitrate === undefined){

I just tested this and the NaN problem is fixed.

Copy link
Contributor

@artonge artonge Apr 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you push the change?

}

if (bufferIndex % 4 == 0){
if (bufferIndex % 4 === 0) {
h = moment.duration(smoothRemainingSeconds, "seconds").humanize({m: 50, h: 50});
}

Expand Down