Latest Notification Is Determined Using String Comparison
Changes: - Added #include "StringHelper.h" to MenuHelper.h for utility functions. - Updated displayNewNotification() to compare notification IDs using util::extractNumber() instead of raw string comparison. - Ensured numeric ordering of notifications by extracting and comparing integer values from IDs. - Preserved existing notification selection logic while improving accuracy of ID comparisons. Fixes #2081
This commit is contained in:
@@ -28,6 +28,7 @@ Date: 21-May-2026
|
||||
#include "Utility.h"
|
||||
#include "Validator.h"
|
||||
#include "Vector.h"
|
||||
#include "StringHelper.h"
|
||||
|
||||
/*
|
||||
Function: displayAllServices
|
||||
@@ -1430,7 +1431,7 @@ inline void displayNewNotification(util::Vector<const Notification*> notificatio
|
||||
}
|
||||
else
|
||||
{
|
||||
if (notification->getId() < notifications[index]->getId())
|
||||
if (util::extractNumber(notification->getId()) < util::extractNumber(notifications[index]->getId()))
|
||||
{
|
||||
notification = notifications[index];
|
||||
}
|
||||
@@ -1450,4 +1451,4 @@ inline void displayNewNotification(util::Vector<const Notification*> notificatio
|
||||
MB_OK |
|
||||
MB_ICONINFORMATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user