Skip to content

Commit a266202

Browse files
authored
notifications: Dismiss to watchface when empty (#1716)
Set `running` to false to flag end of watchface when there are no more notifications left to display. I found it slightly annoying that dismissing all notifications leaves me with a "No notification to display" message. Instead of dismissing to a relatively useless message, dismiss to watchface.
1 parent c8236af commit a266202

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/displayapp/screens/Notifications.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ void Notifications::Refresh() {
8282

8383
} else if (mode == Modes::Preview && dismissingNotification) {
8484
running = false;
85-
currentItem = std::make_unique<NotificationItem>(alertNotificationService, motorController);
8685

8786
} else if (dismissingNotification) {
8887
dismissingNotification = false;
@@ -113,11 +112,11 @@ void Notifications::Refresh() {
113112
alertNotificationService,
114113
motorController);
115114
} else {
116-
currentItem = std::make_unique<NotificationItem>(alertNotificationService, motorController);
115+
running = false;
117116
}
118117
}
119118

120-
running = currentItem->IsRunning() && running;
119+
running = running && currentItem->IsRunning();
121120
}
122121

123122
void Notifications::OnPreviewInteraction() {
@@ -173,7 +172,9 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
173172
} else if (nextMessage.valid) {
174173
currentId = nextMessage.id;
175174
} else {
176-
// don't update id, won't be found be refresh and try to load latest message or no message box
175+
// don't update id, notification manager will try to fetch
176+
// but not find it. Refresh will try to load latest message
177+
// or dismiss to watchface
177178
}
178179
DismissToBlack();
179180
return true;

0 commit comments

Comments
 (0)