Merge remote-tracking branch 'origin/develop' into execute-button

This commit is contained in:
Victor Baranov 2018-12-21 15:24:04 +03:00
commit dd109d98fb
2 changed files with 14 additions and 3 deletions

View File

@ -117,8 +117,7 @@ class AccountDropdowns extends Component {
) )
} }
ifHardwareAcc (address) { ifHardwareAcc (keyring) {
const keyring = getCurrentKeyring(address, this.props.network, this.props.keyrings, this.props.identities)
if (keyring && keyring.type.search('Hardware') !== -1) { if (keyring && keyring.type.search('Hardware') !== -1) {
return true return true
} }
@ -130,6 +129,8 @@ class AccountDropdowns extends Component {
let label let label
if (ifContractAcc(keyring)) { if (ifContractAcc(keyring)) {
label = 'CONTRACT' label = 'CONTRACT'
} else if (this.ifHardwareAcc(keyring)) {
label = 'HARDWARE'
} else { } else {
label = 'IMPORTED' label = 'IMPORTED'
} }
@ -287,7 +288,7 @@ class AccountDropdowns extends Component {
}, },
'Copy address to clipboard', 'Copy address to clipboard',
), ),
(!this.ifHardwareAcc(selected) && !(ifContractAcc(keyring))) ? h( (!this.ifHardwareAcc(keyring) && !(ifContractAcc(keyring))) ? h(
DropdownMenuItem, DropdownMenuItem,
{ {
closeMenu: () => {}, closeMenu: () => {},

View File

@ -174,6 +174,16 @@ class SendTransactionScreen extends PersistentForm {
/> : null} /> : null}
</h3> </h3>
) )
// bytes field is not mandatory to fill: 0x is by default
if (params.type.startsWith('bytes') && !Array.isArray(params.type)) {
const inputValues = this.props.inputValues || {}
if (!inputValues[ind]) {
inputValues[ind] = '0x'
this.setState({
inputValues,
})
}
}
const field = ( const field = (
<SendTransactionField <SendTransactionField
key={Math.random()} key={Math.random()}