Notifications : Fix display of notification index/number.
This commit is contained in:
@@ -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;});
|
||||
}
|
||||
|
||||
|
@@ -15,7 +15,6 @@ namespace Pinetime {
|
||||
Id id;
|
||||
bool valid = false;
|
||||
uint8_t index;
|
||||
uint8_t number = TotalNbNotifications;
|
||||
std::array<char, MessageSize+1> message;
|
||||
Categories category = Categories::Unknown;
|
||||
};
|
||||
@@ -29,6 +28,7 @@ namespace Pinetime {
|
||||
bool AreNewNotificationsAvailable();
|
||||
|
||||
static constexpr uint8_t MaximumMessageSize() { return MessageSize; };
|
||||
size_t NbNotifications() const;
|
||||
|
||||
private:
|
||||
Notification::Id GetNextId();
|
||||
|
Reference in New Issue
Block a user