-
Notifications
You must be signed in to change notification settings - Fork 21
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
fix: tokenData are passed now from AddTokenByNetwork consistent with the chosen network #1507
fix: tokenData are passed now from AddTokenByNetwork consistent with the chosen network #1507
Conversation
…the chosen network
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, thx
erc20ContractAddress | ||
}; | ||
onDestroy(() => { | ||
tokenData = isNetworkIdICP(network?.id) |
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.
Can you add a comment about why we do this as it's quite an original pattern?
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.
check now, I updated the logic, maybe it is better?
@peterpeterparker check the new version, maybe it is better? p.s. I tried to do inline, $: tokenData = isNetworkIdICP(network?.id)
? { ledgerCanisterId, indexCanisterId }
: isNetworkIdEthereum(network?.id)
? { erc20ContractAddress }
: {}; but it was giving an error because it was interpreting this as assigning undefined keys |
9148054
to
ae267e8
Compare
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 like it better!
Thanks
Motivation
To be more consistent with the selected network from the dropdown, the data returned are set when the component is destroyed.
Changes
Prop
tokenData
is defined withonDestroy
.