Fixes
This commit is contained in:
parent
b8a3424834
commit
4a3604f78a
10 changed files with 371 additions and 107 deletions
|
|
@ -11,8 +11,7 @@ pub fn spawn_ticker(sender: ComponentSender<App>) {
|
|||
loop {
|
||||
sender.input(AppInput::ClockTick);
|
||||
// Sleep until the top of the next minute — display is HH:MM only.
|
||||
let secs = gtk4::glib::DateTime::now_local()
|
||||
.map_or(0, |dt| dt.second());
|
||||
let secs = gtk4::glib::DateTime::now_local().map_or(0, |dt| dt.second());
|
||||
let wait = (60 - secs.rem_euclid(60)) as u64;
|
||||
tokio::time::sleep(std::time::Duration::from_secs(wait.max(1))).await;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue