diff options
| author | Adam Soltys <[email protected]> | 2026-07-08 08:19:32 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-07-08 08:19:32 -0700 |
| commit | 0fb4b03b48bda2ba187d96d1feb4459716b8e73c (patch) | |
| tree | faaba06a5b9f5591bb30c4aba334b07db6766a27 /src/features/sync.js | |
| parent | 312621af84136fddbe7d7e47ffecc1ba2b38920d (diff) | |
| download | coinosv3-0fb4b03b48bda2ba187d96d1feb4459716b8e73c.tar.gz coinosv3-0fb4b03b48bda2ba187d96d1feb4459716b8e73c.zip | |
Coalesce background renders so user input takes priority
Every wallet.emit() re-rendered the whole screen synchronously. On
refocus after the PWA was backgrounded, a burst of emits (WS reconnect,
the wake scan's several emits, syncFromNostr merge, each live device
snapshot) fired a dozen full-screen rebuilds back-to-back, starving
input — navigation lagged ~2s until the burst drained.
Route the subscription through scheduleRender(), which coalesces emits
into at most one render per animation frame. Direct user actions still
call render() synchronously and cancel any pending frame, so a tap or
navigation always renders immediately and takes priority over background
repaints. rAF also skips rendering while hidden and fires once on
refocus.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Diffstat (limited to 'src/features/sync.js')
0 files changed, 0 insertions, 0 deletions
