Skip to content

Commit

Permalink
Fix division by zero in Android updater
Browse files Browse the repository at this point in the history
- Remove debug logs
  • Loading branch information
DRSchlaubi committed Sep 24, 2023
1 parent 5f604b7 commit aa9a7e6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/android/src/main/java/UpdateAwareAppScope.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,12 @@ fun UpdateAwareAppScope(activity: Activity, content: @Composable () -> Unit) {

val progressListener = remember {
InstallStateUpdatedListener {
Log.e("UPDT", "Got new status: ${it.installStatus()}")
Log.e("UPDT", "Got new status: ${it}")
when (it.installStatus()) {
InstallStatus.PENDING -> progress = State.Pending
InstallStatus.DOWNLOADING -> {
progress =
State.UpdateDownloading(
it.bytesDownloaded().toDouble() / it.totalBytesToDownload().toDouble()
it.bytesDownloaded().toDouble() / it.totalBytesToDownload().toDouble().coerceAtLeast(1.0)
)
}

Expand Down

0 comments on commit aa9a7e6

Please sign in to comment.