Override ownProps with state props in SignatureRequest#6911
Merged
Gudahtt merged 1 commit intoMetaMask:developfrom Jul 26, 2019
Merged
Conversation
The `accounts` prop of `SignatureRequest` was throwing a PropType warning because `accounts` was an object instead of an array. It looks like when the `mergeProps` function was added in MetaMask#6340, the ownProps were accidentally set to override the state props. The now ignored props have been removed from the parent `ConfirmTxScreen` component as well. `conversionRate` was identical to the one retrieved in `SignatureRequest`, and `selectedAddress` differed only in the fallback behaviour when `state.metamask.selectedAddress` does not exist; it will now default to the first account instead (as was the original behavior, prior to MetaMask#6340).
6c7a0b8 to
685560a
Compare
danjm
approved these changes
Jul 26, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
accountsprop ofSignatureRequestwas throwing a PropType warning becauseaccountswas an object instead of an array. It looks like when themergePropsfunction was added in #6340, the ownProps were accidentally set to override the state props.The now ignored props have been removed from the parent
ConfirmTxScreencomponent as well.conversionRatewas identical to the one retrieved inSignatureRequest, andselectedAddressdiffered only in the fallback behaviour whenstate.metamask.selectedAddressdoes not exist; it will now default to the first account instead (as it did prior to #6340).