From a197a1d2cb78fc7f884c1c6fb269db4b3ff602da Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Sun, 24 Nov 2024 13:56:15 +0900 Subject: [PATCH] fix: pick time panic --- lala_bar/src/music_bar.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lala_bar/src/music_bar.rs b/lala_bar/src/music_bar.rs index a8c7999..373c712 100644 --- a/lala_bar/src/music_bar.rs +++ b/lala_bar/src/music_bar.rs @@ -728,9 +728,9 @@ impl MultiApplication for LalaMusicBar { }); } } - - Message::Submit(date) => { - self.date = date; + // NOTE: it is meaningless to pick the date now + Message::Submit(_date) => { + //self.date = date; self.show_picker = false; } Message::Cancel => { @@ -1140,12 +1140,14 @@ impl MultiApplication for LalaMusicBar { } Message::RequestUpdateTime => { self.datetime = Local::now(); + self.date = self.datetime.date_naive().into(); + self.time = self.datetime.time().into() } Message::Ready(sender) => self.sender = Some(sender), Message::LinkClicked(_link) => { // I do not care } - _ => unreachable!(), + _ => {} } Command::none() }