From 21aaacc8b4eb330e35109eaa48a08710a03eef1a Mon Sep 17 00:00:00 2001 From: archipelago Date: Sun, 14 Jun 2026 04:35:21 -0400 Subject: [PATCH] =?UTF-8?q?fix(ui):=20guard=20receive-code=20index=20acces?= =?UTF-8?q?s=20=E2=80=94=20unblocks=20v1.7.91=20frontend=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit codeMatch[1] is string|undefined under noUncheckedIndexedAccess; using it directly as an index into RECEIVE_CODE_MESSAGES failed vue-tsc (TS2538) and aborted create-release.sh at the frontend build step. Bind to a const and narrow before indexing. Co-Authored-By: Claude Opus 4.8 (1M context) --- neode-ui/src/utils/bitcoinReceive.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neode-ui/src/utils/bitcoinReceive.ts b/neode-ui/src/utils/bitcoinReceive.ts index 71a133ef..606b02c9 100644 --- a/neode-ui/src/utils/bitcoinReceive.ts +++ b/neode-ui/src/utils/bitcoinReceive.ts @@ -19,9 +19,9 @@ export function explainReceiveAddressFailure(error: unknown): string { const message = error instanceof Error ? error.message : String(error || '') // Prefer the structured reason code when present. - const codeMatch = message.match(/\[([A-Z_]+)\]/) - if (codeMatch && RECEIVE_CODE_MESSAGES[codeMatch[1]]) { - return RECEIVE_CODE_MESSAGES[codeMatch[1]] + const code = message.match(/\[([A-Z_]+)\]/)?.[1] + if (code && RECEIVE_CODE_MESSAGES[code]) { + return RECEIVE_CODE_MESSAGES[code] } const lower = message.toLowerCase()