-
Notifications
You must be signed in to change notification settings - Fork 41
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
Analytics #1777
base: master
Are you sure you want to change the base?
Analytics #1777
Conversation
// we are tracking 'Insufficient funds' 'Out of gas' 'No routes found' and 'No quotes found' | ||
if (!quote || !inputAsset || !outputAsset || !inputAmount) return; | ||
|
||
if ( |
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.
what is the point of the lastParams logic
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.
to not send repeated events, like if nothing changed but it triggered a refetch or something, it's the exact same code as the app
return false; | ||
}, | ||
exact: false, | ||
})[0]; |
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.
i think this is dangerous, what if the result of getQueriesData is undefined
or []
?
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.
react-query should always return an array, []
is desired
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.
but you can't get the 0
index of an empty array
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.
it's undefined
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.
oh lmao
chainId, | ||
time, | ||
}: PriceChartQueryKeyArgs) { | ||
return queryClient.getQueriesData({ |
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.
if you pass a type parameter here like getQueriesData<QueryKeyType>()
you won't need to do the type assertion on line 169
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.
the generic types the data, not the key
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.
you might be able to specify the key type like getQueriesData<unknown, Error, unknown, PriceChartQueryKey>()
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 😔
@derHowie Need 1 more review here when you get a chance |
Fixes BX-1709 BX-1708 BX-1712
Figma link (if any):
What changed (plus any additional context for devs)
same as rainbow-me/rainbow#6287
Screen recordings / screenshots
What to test