Skip to content
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

Merged
merged 6 commits into from
Jun 11, 2024
Merged

Add entry point for other networks #5824

merged 6 commits into from
Jun 11, 2024

Conversation

walmat
Copy link
Contributor

@walmat walmat commented Jun 6, 2024

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

Copy link

linear bot commented Jun 6, 2024

@walmat walmat added the swaps v2 label Jun 6, 2024
@@ -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;
Copy link
Contributor Author

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.

Comment on lines +130 to +132
const inputProgress = useSharedValue(
initialSelectedOutputAsset && !initialSelectedInputAsset ? NavigationSteps.TOKEN_LIST_FOCUSED : NavigationSteps.INPUT_ELEMENT_FOCUSED
);
Copy link
Contributor Author

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

Comment on lines +152 to +154
if (Number(availableBalance) === 0) {
return 0;
}
Copy link
Contributor Author

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?

Comment on lines +119 to +121
} else {
swapsStore.setState({ inputAsset: null });
}
Copy link
Contributor Author

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.

Comment on lines +80 to +81
} else {
swapsStore.setState({ inputAsset: null });
Copy link
Contributor Author

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

@walmat walmat merged commit 9b668f8 into develop Jun 11, 2024
6 checks passed
@walmat walmat deleted the @matthew/APP-1578 branch June 11, 2024 00:01
BrodyHughes added a commit that referenced this pull request Jun 11, 2024
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants