notification: Prevent the timer to be started early in the constructor.
Otherwise the timer will be started before the preset is applied.
This commit is contained in:
parent
b9d19988b9
commit
84ae41422f
|
@ -439,7 +439,11 @@ end
|
||||||
function notification:reset_timeout(new_timeout)
|
function notification:reset_timeout(new_timeout)
|
||||||
if self.timer then self.timer:stop() end
|
if self.timer then self.timer:stop() end
|
||||||
|
|
||||||
self.timeout = new_timeout or self.timeout
|
-- Do not set `self.timeout` to `self.timeout` since that would create the
|
||||||
|
-- timer before the constructor ends.
|
||||||
|
if new_timeout and self.timer then
|
||||||
|
self.timeout = new_timeout or self.timeout
|
||||||
|
end
|
||||||
|
|
||||||
if self.timer and not self.timer.started then
|
if self.timer and not self.timer.started then
|
||||||
self.timer:start()
|
self.timer:start()
|
||||||
|
|
Loading…
Reference in New Issue