From 1445e23a26c6581ad0c3f5b5016e47e95d224e9f Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 20 Feb 2022 09:33:55 +0100 Subject: Save repetition in events But don’t show repetead events for now. --- src/app/update.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/app/update.rs') diff --git a/src/app/update.rs b/src/app/update.rs index baf4651..4e21050 100644 --- a/src/app/update.rs +++ b/src/app/update.rs @@ -48,15 +48,13 @@ pub async fn event_handler(rx: Receiver, mut app: App) { None => println!("Event not found when updating from {:?} to {:?}", old, new), } } - Msg::DeleteEvent { event } => { - match app.events.iter().position(|e| e.id == event.id) { - Some(index) => { - app.events.remove(index); - calendar::refresh_date(&app, event.date); - } - None => println!("Event not found when trying to delete {:?}", event), + Msg::DeleteEvent { event } => match app.events.iter().position(|e| e.id == event.id) { + Some(index) => { + app.events.remove(index); + calendar::refresh_date(&app, event.date); } - } + None => println!("Event not found when trying to delete {:?}", event), + }, } } } -- cgit v1.2.3