From 186012aabce9fd16cd6d99afdd950478ec75cde7 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Sun, 11 Aug 2024 11:22:33 +0859 Subject: [PATCH] fix: some time also need count down --- lala_bar/src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lala_bar/src/main.rs b/lala_bar/src/main.rs index ca6ce14..fba8736 100644 --- a/lala_bar/src/main.rs +++ b/lala_bar/src/main.rs @@ -620,7 +620,11 @@ impl MultiApplication for LalaMusicBar { return Command::batch(commands); } Message::RemoveNotify(id) => { - let NotifyUnit { id: notify_id, .. } = self.notifications.get(&id).unwrap().unit; + let NotifyUnitWidgetInfo { + counter, + unit: NotifyUnit { id: notify_id, .. }, + .. + } = self.notifications.get(&id).unwrap().clone(); self.sender .try_send(NotifyCommand::ActionInvoked { id: notify_id, @@ -639,6 +643,9 @@ impl MultiApplication for LalaMusicBar { if unit.upper > removed_pos { unit.upper -= 135; } + if unit.counter > counter { + unit.counter -= 1; + } commands.push(Command::single( LaLaShellIdAction::new( *id,