From 52bc0cd623d62f8bf074e3b4c03f11ab2dd05fbd Mon Sep 17 00:00:00 2001
From: Riku Isokoski <riksu9000@gmail.com>
Date: Sat, 21 Jan 2023 13:30:10 +0200
Subject: [PATCH] infineat: Battery display simplification

---
 src/displayapp/screens/WatchFaceInfineat.cpp | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/displayapp/screens/WatchFaceInfineat.cpp b/src/displayapp/screens/WatchFaceInfineat.cpp
index 5bd44a90..9f12d0a1 100644
--- a/src/displayapp/screens/WatchFaceInfineat.cpp
+++ b/src/displayapp/screens/WatchFaceInfineat.cpp
@@ -409,17 +409,13 @@ void WatchFaceInfineat::Refresh() {
 
   batteryPercentRemaining = batteryController.PercentRemaining();
   isCharging = batteryController.IsCharging();
-  // We store if battery and charging are updated before calling Get(),
-  // since Get() sets isUpdated to false.
-  bool isBatteryUpdated = batteryPercentRemaining.IsUpdated();
-  bool isChargingUpdated = isCharging.IsUpdated();
-  if (isCharging.Get()) { // Charging battery animation
+  if (batteryController.IsCharging()) { // Charging battery animation
     chargingBatteryPercent += 1;
     if (chargingBatteryPercent > 100) {
       chargingBatteryPercent = batteryPercentRemaining.Get();
     }
     SetBatteryLevel(chargingBatteryPercent);
-  } else if (isChargingUpdated || isBatteryUpdated) {
+  } else if (isCharging.IsUpdated() || batteryPercentRemaining.IsUpdated()) {
     chargingBatteryPercent = batteryPercentRemaining.Get();
     SetBatteryLevel(chargingBatteryPercent);
   }