From 1e1422a3dd8ff7172afdb174c808674162d5e6c0 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sat, 5 Apr 2025 08:19:49 -0500 Subject: [PATCH] Only handle the most recent message for each event in the alert model --- scwx-qt/source/scwx/qt/model/alert_model.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scwx-qt/source/scwx/qt/model/alert_model.cpp b/scwx-qt/source/scwx/qt/model/alert_model.cpp index fed7cc17..516dbfae 100644 --- a/scwx-qt/source/scwx/qt/model/alert_model.cpp +++ b/scwx-qt/source/scwx/qt/model/alert_model.cpp @@ -335,8 +335,15 @@ void AlertModel::HandleAlert(const types::TextEventKey& alertKey, double distanceInMeters; - // Get the most recent segment for the event 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 alertSegment = alertMessages[messageIndex]->segments().back();