Files
Arkie-Library-Frontend/.unipi/docs/fix/2026-06-04-wallet-no-account-message-fix.md

31 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2026-06-04 11:14:52 +08:00
---
title: "Wallet No Account Message — Quick Fix"
type: quick-fix
date: 2026-06-04
---
# Wallet No Account Message — Quick Fix
## Bug
When a wallet provider was detected but returned no account, the wallet login UI displayed the raw internal error key `walletNoAccount`.
## Root Cause
`connectInjectedWallet` throws `Error("walletNoAccount")`, but the modal and toast paths rendered `error.message` directly. The locale dictionaries also did not define a friendly `walletNoAccount` message.
## Fix
Translate wallet error keys before rendering them, and add user-facing English and Simplified Chinese text for `walletNoAccount`.
### Files Modified
- `src/wallet/WalletLoginModal.tsx` — translate wallet error messages before showing modal errors.
- `src/wallet/WalletProvider.tsx` — translate wallet error messages before showing toast errors.
- `src/locales/en.ts` — added English `walletNoAccount` copy.
- `src/locales/zh-CN.ts` — added Simplified Chinese `walletNoAccount` copy.
## Verification
- `npx tsc --noEmit`
- `npm run format:check`
- `npm test`
## Notes
The underlying login behavior is unchanged. This only replaces the raw internal key with a user-friendly explanation to unlock/select a wallet account and retry.