Skip to content

Commit

Permalink
fix: progress bar and animation with 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Allène committed Jun 9, 2024
1 parent 5a1dbde commit a35c6c5
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2766,7 +2766,7 @@ final class RootViewController: UIViewController, ObservableObject {


// disable the chart animation if it's just a normal update, enable it if the call comes from didAppear()
if animate {
if animate && UserDefaults.standard.animateProgressBar {
self.pieChartOutlet.animDuration = ConstantsStatistics.pieChartAnimationSpeed
} else {
self.pieChartOutlet.animDuration = 0
Expand Down Expand Up @@ -3147,7 +3147,12 @@ final class RootViewController: UIViewController, ObservableObject {
} else {

// fill in the labels to show sensor time elapsed and max age
dataSourceSensorCurrentAgeOutlet.text = sensorStartDate?.daysAndHoursAgo()
if UserDefaults.standard.reverseProgressBar {
dataSourceSensorCurrentAgeOutlet.text = sensorTimeLeftInMinutes.minutesToDaysAndHours()
} else {
dataSourceSensorCurrentAgeOutlet.text = sensorStartDate?.daysAndHoursAgo()
}


dataSourceSensorMaxAgeOutlet.text = " / " + sensorMaxAgeInMinutes.minutesToDaysAndHours()

Expand All @@ -3157,7 +3162,11 @@ final class RootViewController: UIViewController, ObservableObject {
} else {

// fill in the labels to show sensor time elapsed and max age
dataSourceSensorCurrentAgeOutlet.text = sensorStartDate?.daysAndHoursAgo()
if UserDefaults.standard.reverseProgressBar {
dataSourceSensorCurrentAgeOutlet.text = sensorTimeLeftInMinutes.minutesToDaysAndHours()
} else {
dataSourceSensorCurrentAgeOutlet.text = sensorStartDate?.daysAndHoursAgo()
}

dataSourceSensorMaxAgeOutlet.text = " / " + sensorMaxAgeInMinutes.minutesToDaysAndHours()

Expand Down

0 comments on commit a35c6c5

Please sign in to comment.