Skip to content

Commit

Permalink
fix: flight position of the last/first message with a break (#322)
Browse files Browse the repository at this point in the history
We assumed that the last message is always the last messages of the
flight, but it is not the case when there is a break before the
message. The same is true for the first message.
  • Loading branch information
boxdot authored Feb 6, 2025
1 parent f80d394 commit 899443b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions applogic/src/api/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,20 @@ impl UiFlightPosition {
) -> Self {
match (prev_message, next_message) {
(None, None) => Self::Single,
(Some(_prev), None) => Self::End,
(None, Some(_next)) => Self::Start,
(Some(prev), None) => {
if Self::flight_break_condition(prev, message) {
Self::Single
} else {
Self::End
}
}
(None, Some(next)) => {
if Self::flight_break_condition(message, next) {
Self::Single
} else {
Self::Start
}
}
(Some(prev), Some(next)) => {
let at_flight_start = Self::flight_break_condition(prev, message);
let at_flight_end = Self::flight_break_condition(message, next);
Expand Down

0 comments on commit 899443b

Please sign in to comment.