fix(ui): guard receive-code index access — unblocks v1.7.91 frontend build
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) <noreply@anthropic.com>
This commit is contained in:
parent
ab85827187
commit
21aaacc8b4
@ -19,9 +19,9 @@ export function explainReceiveAddressFailure(error: unknown): string {
|
|||||||
const message = error instanceof Error ? error.message : String(error || '')
|
const message = error instanceof Error ? error.message : String(error || '')
|
||||||
|
|
||||||
// Prefer the structured reason code when present.
|
// Prefer the structured reason code when present.
|
||||||
const codeMatch = message.match(/\[([A-Z_]+)\]/)
|
const code = message.match(/\[([A-Z_]+)\]/)?.[1]
|
||||||
if (codeMatch && RECEIVE_CODE_MESSAGES[codeMatch[1]]) {
|
if (code && RECEIVE_CODE_MESSAGES[code]) {
|
||||||
return RECEIVE_CODE_MESSAGES[codeMatch[1]]
|
return RECEIVE_CODE_MESSAGES[code]
|
||||||
}
|
}
|
||||||
|
|
||||||
const lower = message.toLowerCase()
|
const lower = message.toLowerCase()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user