diff --git a/src/session/room/timeline.rs b/src/session/room/timeline.rs index 5359f975..3a4b268f 100644 --- a/src/session/room/timeline.rs +++ b/src/session/room/timeline.rs @@ -179,8 +179,8 @@ impl Timeline { ItemType::DayDivider(date) => Some(date.clone()), _ => None, }); - for (position, date) in divider { - list.insert(position, date); + for (added, (position, date)) in divider.into_iter().enumerate() { + list.insert(position + added, date); } (added + divider_len) as u32