Destroy notification if device is not discharging
This commit is contained in:
parent
b26b4c25b0
commit
c7f3a2a24d
|
@ -158,6 +158,13 @@ local function update(widget)
|
|||
widget.warning_config.preset
|
||||
)
|
||||
|
||||
if device.state ~= power.enums.BatteryState.Discharging and notification then
|
||||
naughty.destroy(
|
||||
notification,
|
||||
naughty.notificationClosedReason.dismissedByCommand
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
local function init(widget)
|
||||
|
|
Loading…
Reference in New Issue