fix(ui): satisfy noUncheckedIndexedAccess in the WG retry ladder
All checks were successful
Demo images / Build & push demo images (push) Successful in 2m43s

vue-tsc in the release build (unlike the gate's type-check) rejects
indexing WG_RETRY_DELAYS_MS with a bare counter; hoist the delay into a
local and gate on undefined instead of the length check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
archipelago 2026-07-20 02:52:43 -04:00
parent c1d309f21f
commit 710f576c77

View File

@ -514,8 +514,9 @@ async function loadWgPeer() {
} catch (e) {
const raw = e instanceof Error ? e.message : ''
const isNetworkErr = WG_NETWORK_ERR.test(raw)
if (isNetworkErr && attempt < WG_RETRY_DELAYS_MS.length && stillOnWgStep()) {
await sleep(WG_RETRY_DELAYS_MS[attempt])
const retryDelay = WG_RETRY_DELAYS_MS[attempt]
if (isNetworkErr && retryDelay !== undefined && stillOnWgStep()) {
await sleep(retryDelay)
if (stillOnWgStep()) continue
}
// fetch()'s raw "Failed to fetch" means the node itself was unreachable