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

Address prop types errors #6481

Merged
merged 2 commits into from
Apr 18, 2019
Merged

Address prop types errors #6481

merged 2 commits into from
Apr 18, 2019

Conversation

danjm
Copy link
Contributor

@danjm danjm commented Apr 18, 2019

Fixes first two items of #6474

The first was caused by the existence of both number and string decimals in the state.metamask.tokens list. #6475 doesn't fully fix the issue, because depending on how a token is added to the list, the decimals could be a string and not a number.

This PR fixes this by allowing decimals to be either string or number. In addition, this PR gets to the root of the issue by ensuring that all tokens in our list have decimals properties of type Number. These fixes are made in 8a82e62

The second item of #6474 is fixed in 8c075b7 The provider was always receiving objects for its activeCurrency prop because of a bug in the getSelectedAsset selector. This is corrected so that the selector only returns token symbol strings, not whole objects.

@danjm danjm requested a review from whymarrh as a code owner April 18, 2019 00:02
@whymarrh
Copy link
Contributor

This PR fixes this by allowing decimals to be either string or number. In addition, this PR gets to the root of the issue by ensuring that all tokens in our list have decimals properties of type Number. These fixes are made in 8a82e62

If all tokens have decimal properties of type Number, why do we need to allow both types in the prop type check?

@metamaskbot
Copy link
Collaborator

Builds ready [8a82e62]: chrome, firefox, edge, opera

@danjm
Copy link
Contributor Author

danjm commented Apr 18, 2019

@whymarrh To accomodate users who already have one our the other saved to state

@danjm
Copy link
Contributor Author

danjm commented Apr 18, 2019

@whymarrh To accomodate users who already have one our the other saved to state

although, perhaps that means we need a migration...

@danjm
Copy link
Contributor Author

danjm commented Apr 18, 2019

@whymarrh Created an issue for the migration #6482

Copy link
Contributor

@tmashuang tmashuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tmashuang tmashuang merged commit 4fa9576 into develop Apr 18, 2019
@tmashuang tmashuang deleted the address-prop-types-errors branch April 18, 2019 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants