fix(battery): restore defaults if unsetting charge limits
This commit is contained in:
parent
fddfc0b684
commit
3ba34931e7
2 changed files with 24 additions and 1 deletions
|
|
@ -4,7 +4,7 @@
|
|||
use crate::{
|
||||
backend::{
|
||||
Power, PowerProfileRequest, PowerProfileUpdate, get_charging_limit,
|
||||
power_profile_subscription, set_charging_limit,
|
||||
power_profile_subscription, set_charging_limit, unset_charging_limit,
|
||||
},
|
||||
config,
|
||||
dgpu::{Entry, GpuUpdate, dgpu_subscription},
|
||||
|
|
@ -310,6 +310,10 @@ impl cosmic::Application for CosmicBatteryApplet {
|
|||
return cosmic::iced::Task::perform(set_charging_limit(), |_| {
|
||||
cosmic::Action::None
|
||||
});
|
||||
} else {
|
||||
return cosmic::iced::Task::perform(unset_charging_limit(), |_| {
|
||||
cosmic::Action::None
|
||||
});
|
||||
}
|
||||
}
|
||||
Message::Errored(why) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue