fix(naughty.notification): Ensure correct state for the internal timer

This commit is contained in:
Lucas Schwiderski 2022-05-31 13:09:32 +02:00
parent f33f2dedae
commit 5950b62899
No known key found for this signature in database
GPG Key ID: AA12679AAA6DF4D8
1 changed files with 5 additions and 1 deletions

View File

@ -544,7 +544,11 @@ end
function notification:set_timeout(timeout)
timeout = timeout or 0
if self.timer and self._private.timeout == timeout then return end
-- Even if the value is the same, the internal timer might be in an incorrect state.
-- We need to check that first, and continue with the stuff below, if necessary.
if self._private.timeout == timeout and ((not self.timer and timeout == 0) or self.timer) then
return
end
-- 0 == never
if timeout > 0 then