fix: show loading indicator instead of no-wallet during wallet deletion#10555
fix: show loading indicator instead of no-wallet during wallet deletion#10555PatrickChoo wants to merge 5 commits intoOneKeyHQ:xfrom
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
7 similar comments
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
3d3c769 to
1ac035e
Compare
When deleting a wallet with multiple wallets present, the UI briefly flashed the "No Wallet" empty state before auto-selecting the next wallet. Use accountSelectorSyncLoadingAtom to show a spinner during the async transition instead. Also fix AndroidManifest intent tag with multiple data schemes. OK-51091 OK-51094
…egression - Add accountUtils.hasNoUsableWallet() to eliminate 5x duplicated logic - Remove hideNoWalletTrigger from shared AccountSelectorTriggerBase to avoid hiding trigger in Swap/RewardCenter contexts - Add platformEnv.isWebDappMode exclusion in WalletConnectionGroup and AccountSelectorTriggerHome to preserve Connect button in web dapp mode - Show Spinner instead of blank state during sync loading in HomePageView
Every header/trigger consumer was hand-rolling the same `syncLoading?.[num]?.isLoading` read after subscribing to the full accountSelectorSyncLoadingAtom. Centralize it in a single hook so the call sites stop copy-pasting the same nullable chain and the atom subscription has a single place to swap in slot-keyed derivation later if we ever need to narrow the re-render surface. Applied to the six components that this PR already touches: HomePageView, HeaderRight, MDHeader, WalletConnectionGroup, TabPageHeader/index, AccountSelectorTriggerHome. The two DApp trigger variants (NetworkSelectorTriggerDApp / AccountSelectorTriggerDApp) pair the read with `|| mockIsLoading`, so they stay on the raw atom for now and are out of scope.
- Remove hasNoUsableWallet from ITabPageHeaderProp, TabPageHeader, MDHeader, InPageHeader — each component now derives the value from useActiveAccount + accountUtils.hasNoUsableWallet - Remove unnecessary useMemo wrapping trivial boolean check in WalletConnectionGroup and HomePageView - Trim verbose comment on useIsAccountSelectorSyncLoading hook
- SelectorTrigger: add !platformEnv.isWebDappMode check for consistency with other guard sites, preventing accidental hiding in dapp mode - HomePageView: extract NoWalletContent component to isolate isSyncLoading subscription, removing it from the homePage useMemo deps to avoid two full-page re-renders per wallet deletion
1ac035e to
a6a61d3
Compare
|
Closing in favor of a clean PR with rebased commits and review fixes applied. |
Summary
accountSelectorSyncLoadingAtom.HomePageView,AccountSelectorTriggerHome,SelectorTrigger,WalletConnectionGroup,MDHeader, andInPageHeader.accountUtils.hasNoUsableWallet()to replace duplicated no-wallet detection logic, replacing the coarseif (wallet)check with a precise!wallet || (isOthersWallet && !account)condition.useIsAccountSelectorSyncLoading(num)hook to centralize sync loading reads.NoWalletContentcomponent to isolate sync loading subscription from theHomePageViewpage memo.Jira
Test plan