InfiniTime.git

commit 6b5235c3013bf8ecbd1568669f48efce3508e8c0

Author: John Crawford <61567332+KaffeinatedKat@users.noreply.github.com>

fix: heartrate app displays --- instead of 000 (#1887)

 src/displayapp/screens/HeartRate.cpp | 10 +++++++---


diff --git a/src/displayapp/screens/HeartRate.cpp b/src/displayapp/screens/HeartRate.cpp
index f611fa263a1a22195c16fd2f852253d470540210..9677be3b81ace8ed7f1556b9b5bfa25d649b68d0 100644
--- a/src/displayapp/screens/HeartRate.cpp
+++ b/src/displayapp/screens/HeartRate.cpp
@@ -41,7 +41,7 @@   } else {
     lv_obj_set_style_local_text_color(label_hr, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray);
   }
 
-  lv_label_set_text_static(label_hr, "000");
+  lv_label_set_text_static(label_hr, "---");
   lv_obj_align(label_hr, nullptr, LV_ALIGN_CENTER, 0, -40);
 
   label_bpm = lv_label_create(lv_scr_act(), nullptr);
@@ -82,10 +82,14 @@   switch (state) {
     case Controllers::HeartRateController::States::NoTouch:
     case Controllers::HeartRateController::States::NotEnoughData:
       // case Controllers::HeartRateController::States::Stopped:
-      lv_label_set_text_static(label_hr, "000");
+      lv_label_set_text_static(label_hr, "---");
       break;
     default:
-      lv_label_set_text_fmt(label_hr, "%03d", heartRateController.HeartRate());
+      if (heartRateController.HeartRate() == 0) {
+        lv_label_set_text_static(label_hr, "---");
+      } else {
+        lv_label_set_text_fmt(label_hr, "%03d", heartRateController.HeartRate());
+      }
   }
 
   lv_label_set_text_static(label_status, ToString(state));