Skip to content

Commit 264b5be

Browse files
authored
WatchFacePineTimeStyle: Fix conditional in weather display (#1965)
Since returning a valid weather is always considered an updated value, if the current weather is empty, the face will attempt to display the temperature and icon as empty values, rather than clearing the labels.
1 parent 0503248 commit 264b5be

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/displayapp/screens/WatchFacePineTimeStyle.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,6 @@ void WatchFacePineTimeStyle::Refresh() {
540540
}
541541

542542
currentWeather = weatherService.Current();
543-
544543
if (currentWeather.IsUpdated()) {
545544
auto optCurrentWeather = currentWeather.Get();
546545
if (optCurrentWeather) {
@@ -551,12 +550,10 @@ void WatchFacePineTimeStyle::Refresh() {
551550
temp = temp / 100 + (temp % 100 >= 50 ? 1 : 0);
552551
lv_label_set_text_fmt(temperature, "%d°", temp);
553552
lv_label_set_text(weatherIcon, Symbols::GetSymbol(optCurrentWeather->iconId));
554-
lv_obj_realign(temperature);
555-
lv_obj_realign(weatherIcon);
553+
} else {
554+
lv_label_set_text(temperature, "--");
555+
lv_label_set_text(weatherIcon, Symbols::ban);
556556
}
557-
} else {
558-
lv_label_set_text(temperature, "--");
559-
lv_label_set_text(weatherIcon, Symbols::ban);
560557
lv_obj_realign(temperature);
561558
lv_obj_realign(weatherIcon);
562559
}

0 commit comments

Comments
 (0)