-
Notifications
You must be signed in to change notification settings - Fork 991
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
[#21354] Exception when navigating back from route generation #21381
Conversation
@mariia-skrypnyk |
@@ -158,16 +158,14 @@ | |||
active-screen? (= view-id current-screen-id) | |||
bottom (safe-area/get-bottom) | |||
[crypto-currency? set-crypto-currency] (rn/use-state initial-crypto-currency?) | |||
on-navigate-back on-navigate-back |
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.
Redundant binding
{fiat-currency :currency} (rf/sub [:profile/profile]) | ||
{token-symbol :symbol | ||
{token-symbol :symbol | ||
token-networks :networks | ||
:as | ||
token} (rf/sub [:wallet/wallet-send-token]) | ||
:as token} (rf/sub [:wallet/wallet-send-token]) |
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.
Just a code style fix
:button-one-label (i18n/label :t/review-send) | ||
:enabled-from-chain-ids (rf/sub | ||
[:wallet/wallet-send-enabled-from-chain-ids]) | ||
:enabled-from-chain-ids (rf/sub [:wallet/wallet-send-enabled-from-chain-ids]) |
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.
Again, just a code style fix
[crypto fiat-price] | ||
(when-let [^js bn (bignumber crypto)] | ||
(-> (.times bn ^js (bignumber fiat-price)) | ||
(with-precision 2)))) | ||
(let [^js crypto-bn (bignumber crypto) | ||
^js fiat-price-bn (bignumber fiat-price)] | ||
(when (and crypto-bn fiat-price-bn) | ||
(-> crypto-bn | ||
(.times fiat-price-bn) | ||
(with-precision 2))))) | ||
|
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.
Now the implementation checks that both numbers are bignumbers.
I considered to use fnil
as:
(fnil bignumber 0)
But I was afraid that it broke existing usages where we relied on:
(bignumber nil) ;; => nil
Jenkins Builds
|
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
86% of end-end tests have passed
Failed tests (1)Click to expandClass TestCommunityMultipleDeviceMerged:
Passed tests (6)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityOneDeviceMerged:
Class TestWalletOneDevice:
Class TestWalletMultipleDevice:
|
@ulisesmac thank you for the PR. Ready for merge. |
- Slightly improved code styles
9b262fa
to
6fa6209
Compare
fixes #21354
Summary
This PR solves the exception when fastly navigating back once the routes arrive.
The problem happened because the⚠️ ), was
conversion-rate
used to calculate thefiat->crypto
value (calculated in the view nsnil
when navigating back.Video of the issue solved:
Screencast.from.2024-10-03.19-04-56.mp4
Review notes
The component
status-im.contexts.wallet.send.input-amount.view/view
needs a refactor, there a lot of calculations made in the view and thelet
bindings to understand the logic of it is giant.Platforms
Steps to test
Please follow the video in the issue description and check is no longer reproducible.
status: ready