8ef109b58e21

pre-warm Reed-Solomon WASM on Codex mount — surfaces load failures before word-confirmation flow

time
2026-05-17 13:41 UTC · 5 months ago
machine
koh2
parent
11fdad68e46b
1 file src/popup/views/CodexGenerateView.tsx+13 −0
src/popup/views/CodexGenerateView.tsx+13 −0
@@ -31,6 +31,7 @@3131   generateCodex,3232   pickConfirmationPositions,3333 } from "../codex/generate";34+import { getReedSolomon } from "../codex/rs-loader";3435 import type { VaultEntry } from "../../shared/types";3536 3637 interface CodexGenerateViewProps {@@ -95,6 +96,18 @@9596     }9697 9798     setConfirmPositions(pickConfirmationPositions());99+100+    // Pre-warm the Reed-Solomon WASM so load failures surface before the101+    // user completes the word-confirmation flow.102+    try {103+      await getReedSolomon();104+    } catch (err) {105+      setLoadError(106+        `Failed to load Codex library: ${err instanceof Error ? err.message : String(err)}`107+      );108+      setLoading(false);109+      return;110+    }98111 99112     if (res.data.slotA) {100113       try {

view file