Skip to content

Commit

Permalink
Indicate unread if there is a message on disk and there is no specifi…
Browse files Browse the repository at this point in the history
…ed read marker.
  • Loading branch information
andymandias committed Sep 18, 2024
1 parent fee53fd commit dd2a4a1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions data/src/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,11 @@ impl History {
} => {
// Read marker is prior to last message on disk
// or prior to unflushed messages in memory
last_on_disk
.zip(metadata.read_marker)
.map_or(false, |(a, b)| a > b.date_time())
|| metadata.unread_count(messages) > 0
last_on_disk.zip(metadata.read_marker).map_or(
last_on_disk.is_some() && metadata.read_marker.is_none(),
|(a, b)| a > b.date_time(),
) || metadata.unread_count(messages) > 0
}
}
History::Full { .. } => false,
}
Expand Down

0 comments on commit dd2a4a1

Please sign in to comment.