Time: Set minimum wait for subscription to 1ms
The Clock was freezing with ``` ERRO thread 'main' panicked at '`period` must be non-zero.', /home/system76/ca/cosmic-applets/applets/cosmic-applet-time/vendor/iced_futures/src/backend/native/tokio.rs:62:21 ```
This commit is contained in:
parent
31362c7dc1
commit
11eb4cefc2
1 changed files with 1 additions and 1 deletions
|
|
@ -100,7 +100,7 @@ impl Application for Time {
|
|||
.expect("Setting seconds to 0 should always be possible")
|
||||
.with_nanosecond(0)
|
||||
.expect("Setting nanoseconds to 0 should always be possible.");
|
||||
let wait = (next - now).num_milliseconds();
|
||||
let wait = 1.max((next - now).num_milliseconds());
|
||||
time::every(Duration::from_millis(
|
||||
wait.try_into().unwrap_or(FALLBACK_DELAY),
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue