Web: check the autosave deadline from the font-poll tick (#1775)

A ten-minute time::every on wasm piles up long setTimeouts in the shared
wasmtimer driver until it stops waking every timer, which silenced the
automation channel and drop-open about 8 s after load.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-14 12:21:11 +03:00
1 parent 814dd2e3d6
commit d915489a67
2 files changed
+36 -5

No files matched your search

+4 -2
View File
@@ -2512,8 +2512,10 @@ impl OpenCADStudio {
let web_fonts = Subscription::none();
// Periodic autosave (SAVETIME): a `.sv$` recovery copy beside the file
// on native, an OPFS snapshot on web. SAVETIME is the interval in
// minutes; 0 disables it.
let autosave = if self.savetime_min > 0 {
// minutes; 0 disables it. The web build checks the deadline from the
// `PollWebFonts` tick instead: a long `time::every` there stalls every
// other timer for its whole period (#1775).
let autosave = if self.savetime_min > 0 && cfg!(not(target_arch = "wasm32")) {
iced::time::every(std::time::Duration::from_secs(
self.savetime_min as u64 * 60,
))