-
-
Notifications
You must be signed in to change notification settings - Fork 952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
notifications: Dismiss to watchface when empty #1716
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(); | ||
Comment on lines
-120
to
+119
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change isn't necessary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is safer. Setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see. I didn't realize that currentItem is left a nullptr in another function, and removing line 116 means it stays nullptr. Looks like this is more of an issue with code clarity. You should squash the fixup commits and explain these things in the commit message. |
||
} | ||
|
||
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; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this line has been deleted because it isn't necessary. Can you confirm the intent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right. No longer necessary.
running
is set tofalse
. Previously,currentItem
would be populated with the "No notifications to display" notification item.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this is for the preview mode, so I believe it's not exactly necessary for this change. It should be explained in the commit description.