Files
Arkie-Library-Frontend/.unipi/docs/fix/2026-06-04-wallet-verification-popup-logged-in-fix.md

40 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

---
title: "Wallet verification popup blocks already logged-in TP browser — Quick Fix"
type: quick-fix
date: 2026-06-04
---
# Wallet verification popup blocks already logged-in TP browser — Quick Fix
## Bug
After Chrome opens TokenPocket's in-app browser through the wallet deeplink, users who are already logged in inside the TP browser still see the new address verification popup. The popup sits on top of an already-authenticated page and blocks normal use.
## Root Cause
The `?autoLogin=` handler in `AutoInjectedLogin` showed the verification prompt as soon as the deeplink parameter existed. It did not wait for `WalletProvider` to finish loading the existing wallet session, and it did not skip the prompt when `status === "loggedIn"`.
## Fix
The auto-login handler now waits while wallet status is `loading`. Once the status is known:
- `loggedIn` strips the deeplink parameter and does not show the verification popup.
- `loggedOut` strips the deeplink parameter and shows the manual address verification prompt.
### Files Modified
- `src/wallet/AutoInjectedLogin.tsx` — only shows the verification gate for logged-out deeplink sessions; already logged-in TP sessions are not blocked.
- `src/wallet/injected.ts` — supports reading a connected injected address without requesting wallet permission.
- `src/locales/zh-CN.ts` — verification popup copy.
- `src/locales/en.ts` — verification popup copy.
## Verification
- `npx tsc --noEmit`
- `npm run format:check`
- `npm test`
## Notes
This preserves the manual verification gate for logged-out Chrome → TokenPocket handoff, while avoiding a blocking popup for users who already have a valid wallet session in TokenPocket's in-app browser.