craft-menu: the rebuild retry reads the framework's Instant, which is the browser clock on wasm

This commit is contained in:
aiongg committed 2026-11-26 05:58:25 +00:00
1 parent dd19e4bf9f
commit 2ac1123a2c
2 files changed
+8 -3

No files matched your search

+2 -1
View File
@@ -3,11 +3,12 @@
use std::borrow::Cow;
use std::collections::HashSet;
use std::sync::{Arc, Mutex, MutexGuard, PoisonError};
use std::time::{Duration, Instant};
use std::time::Duration;
use craft_keymap::{Chord, CommandRef, Key, Mods};
use craft_ui::contract::{MemoKey, MemoProps};
use craft_ui::menu::Alternate;
use craft_ui::runtime::motion::Instant;
use craft_ui::runtime::windows::{KeyEquivalent, WindowAction, WindowHost};
use crate::layout::{Clash, Layout};
+6 -2
View File
@@ -243,10 +243,14 @@ pub(crate) struct Wanted {
wake: Option<f64>,
}
/// The instant type [`now`] returns: `std::time::Instant` on native targets, a clock that works in the browser on
/// wasm.
pub use web_time::Instant;
/// The wall clock's reading, for a host that drives a store on real time (`ShellApp::tick`). It is the one place
/// outside a pass that reads the clock.
pub fn now() -> web_time::Instant {
web_time::Instant::now()
pub fn now() -> Instant {
Instant::now()
}
/// Marks the running viewport as having an animation that is not at its end value.