Repository navigation
Commit 542ef95
release(runway): cherry-pick fix(cashtag): skip when no market cap data (#47934)
- fix(cashtag): skip when no market cap data cp-13.58.0 (#47914)
## **Description**
The X widget still rendered when every matching token had a missing or
zero market cap. Those tickers now produce no result, so no pill or
popover are rendered.
## **Changelog**
CHANGELOG entry: Hide the X widget when none of the matching tokens have
a market cap
<!--
## **Related issues**
Fixes:
-->
## **Manual testing steps**
1. Enable the X widget feature flag and setting.
2. On x.com, open a cashtag whose matches all have no market cap or a
market cap of 0.
3. Confirm no MetaMask pill or widget appears.
4. Open a cashtag such as `$ETH` that has a market cap.
5. Confirm the widget still appears.
<!--
## **Screenshots/Recordings**
### **Before**
### **After**
-->
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Localized cashtag lookup guard with unit tests; no auth or payment
paths affected.
>
> **Overview**
> **`resolveTicker`** now returns **`null`** when the highest market-cap
match has a missing or zero market cap, so the X cashtag widget does not
render for tokens without usable cap data. Matches that include at least
one asset with cap **> 0** behave as before, with zero/null-cap entries
still listed as similar options.
>
> Tests cover the all-invalid-cap case and the mixed list where a priced
asset remains the primary.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
58a23cc. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
[416e0ec](416e0ec)
---------
Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
Co-authored-by: metamask-ci[bot] <271559518+metamask-ci[bot]@users.noreply.github.com>
Co-authored-by: sleepytanya <104780023+sleepytanya@users.noreply.github.com>1 parent e49060a commit 542ef95
2 files changed
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
145 | 196 | | |
146 | 197 | | |
147 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
147 | 153 | | |
148 | 154 | | |
149 | 155 | | |
| |||
0 commit comments