-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track token lists #6303
base: develop
Are you sure you want to change the base?
Track token lists #6303
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but couple questions about performance
|
||
useEffect(() => { | ||
if (searchCurrencyLists.isLoading) return; | ||
const params = { screen: 'swap' as const, total_tokens: 0, no_icon: 0, query }; | ||
for (const assetOrHeader of searchCurrencyLists.results) { | ||
if (assetOrHeader.listItemType === 'header') continue; | ||
if (!assetOrHeader.icon_url) params.no_icon += 1; | ||
params.total_tokens += 1; | ||
} | ||
analyticsV2.track(analyticsV2.event.tokenList, params); | ||
}, [searchCurrencyLists.results, searchCurrencyLists.isLoading, query]); | ||
|
||
return searchCurrencyLists; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does having a useEffect in here have any negative side effects to re-rendering the list?
If it does, we could mount a separate component that listens to react-query subscriptions and doesn't touch the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, it doesn't trigger a rerender ever, just sends track events
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @greg-schrammel, this doesn't appear to be functioning correctly and may not be covering the ticket's requirements. I saw three issues:
- the function meant to track assets on the wallet screen doesn't fire
- the send screen is sending information for the wallet screen
- I don't believe any tracking was added for the discover screen
ah the discover screen I was thinking trending tokens but there is a search there, should I add this tracking for that? |
yes, please |
Fixes APP-2067
What changed (plus any additional context for devs)
tracks token lists, amount of tokens in the list and how many have icons and price
Screen recordings / screenshots
What to test