mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:30:06 +00:00
Only handle the most recent message for each event in the alert model
This commit is contained in:
parent
16507adbe9
commit
1e1422a3dd
1 changed files with 8 additions and 1 deletions
|
|
@ -335,8 +335,15 @@ void AlertModel::HandleAlert(const types::TextEventKey& alertKey,
|
||||||
|
|
||||||
double distanceInMeters;
|
double distanceInMeters;
|
||||||
|
|
||||||
// Get the most recent segment for the event
|
|
||||||
auto alertMessages = p->textEventManager_->message_list(alertKey);
|
auto alertMessages = p->textEventManager_->message_list(alertKey);
|
||||||
|
|
||||||
|
// Skip alert if this is not the most recent message
|
||||||
|
if (messageIndex + 1 < alertMessages.size())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the most recent segment for the event
|
||||||
std::shared_ptr<const awips::Segment> alertSegment =
|
std::shared_ptr<const awips::Segment> alertSegment =
|
||||||
alertMessages[messageIndex]->segments().back();
|
alertMessages[messageIndex]->segments().back();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue