-
Notifications
You must be signed in to change notification settings - Fork 667
Swaps fixes #6573
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
Swaps fixes #6573
Conversation
Haven't ever seen this happen, just in case due to the current lack of proper navigation typing
… network selector handling
…fter account switches
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.
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.
A lot going on here, did a lot of testing and didn't find anything blocking. Code looks good 👍
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.
Tried a bunch of wacky scenarios and didn't encounter any issues. No nits after a cursory look through all the changes.
* Rework `navigateToSwaps` * Swaps bug fixes, performance improvements * Clean up remote config, fix slippage types * Clean up `AnimatedSpinner` image on unmount * Push missing files, lint fixes * Lint * Separate chain badge improvements * Separate user assets store type fixes, clean up error supression * Ensure `getSwapsNavigationParams` always returns valid params Haven't ever seen this happen, just in case due to the current lack of proper navigation typing * Fix swaps network selection input handling * Prevent swaps inputs from clearing unless `Cancel` is pressed, rework network selector handling * Prevent swap input re-render * Limit erratic gas state updates, propagate balance updates in swaps after account switches * Allow user assets to refresh while swaps is open * Remove unnecessary `useCleanupOnUnmount` component wrapper * Fix remaining `hasEnoughFundsForGas` / `maxSwappableAmount` edge cases * Reduce size of `FlipButton` hit box * Handle negative `decimalPlaces` in `scaleUpWorklet`
Fixes APP-2566
Fixes APP-2508
Fixes APP-2368
Fixes APP-2568
What changed (plus any additional context for devs)
quote.value
.swap-provider
re-render triggered byuseAccountSettings
when switching accounts. Now usingcurrency
fromuserAssetsStoreManager
to avoid these re-renders.navigateToSwaps
helper, which removes all the redundant boilerplate from each swaps entry pointnavigateToSwaps
are now applied directly — additional changes stemming from theinputValues
animated reaction no longer occur on mounttrackQuickBuyMetadata
booleanswap-provider
and fixes raps gas typestrackSwapEvent
helper, and removes all JS thread shared value readsmaxSwappableAmount
setAsset
to avoid shared value JS thread reads and JS/UI thread logic redundancysetAsset
instead of waiting for an animated reaction to triggerupdateInputValuesAfterFlip
logic to be clearer and more predictableuseSwapInputsController
animated reactions to limit redundant logic and remove unnecessary workuseAnimatedReaction
instead ofuseDerivedValue
) to prevent erratic updatesSwapNumberPad
where fetches were being triggered for certain edits to the input value that didn't result in the number actually changing (e.g. adding/removing a decimal point, adding/removing zeros to the end of a number containing a decimal point)No Balance
state to the slider which snaps the slider back to zero if there's no input balanceScreen recordings / screenshots
What to test