Notifications : Fix display of notification index/number.
This commit is contained in:
parent
440ae412b9
commit
cabf1168d4
3 changed files with 10 additions and 5 deletions
|
|
@ -28,6 +28,7 @@ void NotificationManager::Push(Pinetime::Controllers::NotificationManager::Categ
|
|||
|
||||
NotificationManager::Notification NotificationManager::GetLastNotification() {
|
||||
NotificationManager::Notification notification = notifications[readIndex];
|
||||
notification.index = 1;
|
||||
return notification;
|
||||
}
|
||||
|
||||
|
|
@ -81,3 +82,7 @@ bool NotificationManager::ClearNewNotificationFlag() {
|
|||
return newNotification.exchange(false);
|
||||
}
|
||||
|
||||
size_t NotificationManager::NbNotifications() const {
|
||||
return std::count_if(notifications.begin(), notifications.end(), [](const Notification& n){ return n.valid;});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue