Skip to content

Commit

Permalink
fix: crash current must not be NaN during bulk download (#63)
Browse files Browse the repository at this point in the history
- Add validation to ensure that the progress value is not NaN.

fixes: LEARNER-10248
  • Loading branch information
farhan-arshad-dev authored and dixidroid committed Nov 26, 2024
1 parent b892560 commit e8278c7
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,12 @@ private fun AllVideosDownloadItem(
)
}
if (isDownloadingAllVideos) {
val progress = 1 - downloadModelsSize.remainingSize.toFloat() / downloadModelsSize.allSize
val progress =
if (downloadModelsSize.allSize == 0L) {
0f
} else {
1 - downloadModelsSize.remainingSize.toFloat() / downloadModelsSize.allSize
}

val animatedProgress by animateFloatAsState(
targetValue = progress,
Expand Down

0 comments on commit e8278c7

Please sign in to comment.