From d21459129cce7d50f1646f32d07196198dfd56ce Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Sun, 3 May 2026 12:09:06 +0200 Subject: [PATCH] =?UTF-8?q?polish(desktop):=20recovery.html=20=E2=80=94=20?= =?UTF-8?q?await=20version=20alongside=20state=20in=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eliminates the brief "Version: loading…" flash in the diagnostic block on first render. Resolves getRecoveryState + getVersion in parallel via Promise.all so the first render call has both. Drops the redundant module-load .then() that set cachedVersion before render ran. --- packages/desktop/resources/recovery.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/desktop/resources/recovery.html b/packages/desktop/resources/recovery.html index ef24820b..9697241a 100644 --- a/packages/desktop/resources/recovery.html +++ b/packages/desktop/resources/recovery.html @@ -213,7 +213,7 @@ } let cachedVersion = 'loading…'; - getVersion().then((v) => { cachedVersion = v; }); + // Populated in init() via Promise.all alongside getRecoveryState. function render(state) { const reasonCode = state.reason?.code ?? null; @@ -274,7 +274,13 @@ return; } try { - const initial = await window.backspace.getRecoveryState(); + // Resolve both in parallel so the first render has the version string + // (otherwise the diagnostic block briefly shows "Version: loading…"). + const [initial, version] = await Promise.all([ + window.backspace.getRecoveryState(), + getVersion(), + ]); + cachedVersion = version; render(initial); } catch (err) { $('hint').textContent = 'Failed to load recovery state: ' + (err && err.message ? err.message : String(err));