Commit 584d9a3
committed
feat: introduce useAssetVisibility hook and AssetsController selectors
- Add getCustomAssets, getAssetsBalance, getAssetsInfo, getAssetPreferences
selectors for AssetsController state with unit tests
- Add useAssetVisibility hook that derives the correct AssetsController
action (addCustomAsset / removeCustomAsset / hideAsset / unhideAsset)
based on the token's current state
- Wire handleHideToken into MoreTokenActionsMenu behind the
isAssetsUnifyStateEnabled feature flag (legacy TokensController path
still runs unconditionally)
- Replace direct AssetsController.addCustomAsset calls in
AddCustomToken and SearchTokenAutocomplete with handleAddCustomAsset
from the hook, removing per-component account-ID lookups
- Fix assets-controller-messenger test: add missing
NetworkController:networkAdded and NetworkController:networkRemoved
events to the arrayContaining assertion1 parent ead9094 commit 584d9a3
9 files changed
Lines changed: 905 additions & 64 deletions
File tree
- app
- components
- UI
- TokenDetails/components
- Tokens/hooks
- Views
- AddAsset/components
- AddCustomToken
- SearchTokenAutoComplete
- AssetOptions
- selectors/assets
Lines changed: 35 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
70 | 83 | | |
71 | 84 | | |
72 | 85 | | |
| |||
127 | 140 | | |
128 | 141 | | |
129 | 142 | | |
130 | | - | |
| 143 | + | |
131 | 144 | | |
132 | 145 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
139 | 164 | | |
140 | 165 | | |
141 | 166 | | |
| |||
172 | 197 | | |
173 | 198 | | |
174 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
175 | 203 | | |
176 | 204 | | |
177 | 205 | | |
| |||
0 commit comments