diff options
| author | Eli Tan <5410435+eliedrian@users.noreply.github.com> | 2024-09-19 04:31:15 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-18 22:31:15 +0200 |
| commit | a2662028317bddf2c0e3060eeb02f202b18d958f (patch) | |
| tree | 3ac8e6ffff23fa9dcbf7f972e616e1a3defc9076 /src/displayapp/screens | |
| parent | c8236afbefbcc4e22150da7324617d853561a0c5 (diff) | |
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.
Diffstat (limited to 'src/displayapp/screens')
| -rw-r--r-- | src/displayapp/screens/Notifications.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index 037c43a7..3a3f5f2b 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -82,7 +82,6 @@ void Notifications::Refresh() { } else if (mode == Modes::Preview && dismissingNotification) { running = false; - currentItem = std::make_unique<NotificationItem>(alertNotificationService, motorController); } else if (dismissingNotification) { dismissingNotification = false; @@ -113,11 +112,11 @@ void Notifications::Refresh() { alertNotificationService, motorController); } else { - currentItem = std::make_unique<NotificationItem>(alertNotificationService, motorController); + running = false; } } - running = currentItem->IsRunning() && running; + running = running && currentItem->IsRunning(); } void Notifications::OnPreviewInteraction() { @@ -173,7 +172,9 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { } else if (nextMessage.valid) { currentId = nextMessage.id; } else { - // don't update id, won't be found be refresh and try to load latest message or no message box + // don't update id, notification manager will try to fetch + // but not find it. Refresh will try to load latest message + // or dismiss to watchface } DismissToBlack(); return true; |
