-
Notifications
You must be signed in to change notification settings - Fork 635
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
Add entry point for other networks #5824
Conversation
…oesn't make sense since they don't have another asset on that chain
@@ -32,7 +32,7 @@ import { queryClient } from '@/react-query'; | |||
import { divWorklet, equalWorklet, greaterThanWorklet, mulWorklet, toFixedWorklet } from '@/__swaps__/safe-math/SafeMath'; | |||
|
|||
function getInitialInputValues(initialSelectedInputAsset: ExtendedAnimatedAssetWithColors | null) { | |||
const initialBalance = Number(initialSelectedInputAsset?.balance.amount) ?? 0; | |||
const initialBalance = initialSelectedInputAsset ? Number(initialSelectedInputAsset?.balance.amount) : 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.
This was NaN
when no initial inputAsset was set.
const inputProgress = useSharedValue( | ||
initialSelectedOutputAsset && !initialSelectedInputAsset ? NavigationSteps.TOKEN_LIST_FOCUSED : NavigationSteps.INPUT_ELEMENT_FOCUSED | ||
); |
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.
for cases where we have an output asset but no initial input asset
if (Number(availableBalance) === 0) { | ||
return 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.
this might not be needed with the NaN check I added, but does this hurt anything to have here?
} else { | ||
swapsStore.setState({ inputAsset: null }); | ||
} |
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.
@christianbaroni I can remove this, but I noticed for cases where we don't have a largest balance on the same chain we still default to the largest overall balance. Is that intended? My thinking is it'd make more sense for users to explicitly select an asset so that we aren't making an initial quote fetch that they (probably) don't want.
} else { | ||
swapsStore.setState({ inputAsset: null }); |
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 was happening here too, so i added it here as well
Co-authored-by: gregs <[email protected]>
…ap-v2-e2e * 'develop' of github.com:rainbow-me/rainbow: Fix weird issues with rounding (#5822) Fix provider recursion bug, provider function types (#5829) bump braces (#5831) Add entry point for other networks (#5824) remove info icon on max transaction fee row as we don't have that in spec (#5827) [e2e] Add Malicious Dapp interaction test (#5764) reorg ens related calls (#5828) Performance: limit Sentry tracking, fix NFT hooks (#5819) fix wrong chainname (#5823) Disable flashbots toggle on appropriate chains (#5812) add type to SearchAsset type and add into type possibilities (#5820) fix fasterimage border radius android (#5816) more Safemath fixes (#5818)
Fixes APP-1578
What changed (plus any additional context for devs)
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-06-06.at.16.53.21.mp4
Screen recordings / screenshots
What to test