diff --git a/fitnesstrax/app/src/view_models/day_detail.rs b/fitnesstrax/app/src/view_models/day_detail.rs index 2cd7224..c4223e9 100644 --- a/fitnesstrax/app/src/view_models/day_detail.rs +++ b/fitnesstrax/app/src/view_models/day_detail.rs @@ -110,6 +110,14 @@ impl DayDetailViewModel { .partition(|r| r.data.is_weight()); let (step_records, records): (Vec>, Vec>) = records.into_iter().partition(|r| r.data.is_steps()); + + if weight_records.len() > 1 { + eprintln!("warning: multiple weight records found for {}. This is unsupported and the one presented is unpredictable.", date.format("%Y-%m-%d")); + } + if step_records.len() > 1 { + eprintln!("warning: multiple step records found for {}. This is unsupported and the one presented is unpredictable.", date.format("%Y-%m-%d")); + } + Ok(Self { provider: Arc::new(provider), date, @@ -454,20 +462,6 @@ mod test { count: 2500, }), }, - Record { - id: RecordId::default(), - data: TraxRecord::Weight(ft_core::Weight { - date: oct_13.clone(), - weight: 91. * si::KG, - }), - }, - Record { - id: RecordId::default(), - data: TraxRecord::Steps(ft_core::Steps { - date: oct_13.clone(), - count: 2750, - }), - }, Record { id: RecordId::default(), data: TraxRecord::BikeRide(ft_core::TimeDistance {