Close and not Cancel on deploy contract #3393

This commit is contained in:
Nicolas Gotchac 2016-11-15 12:50:20 +01:00
parent 2b30d4b75f
commit 723005635a
2 changed files with 11 additions and 10 deletions

View File

@ -46,7 +46,8 @@ function stringToBytes (input) {
if (isArray(input)) {
return input;
} else if (input.substr(0, 2) === '0x') {
return input.substr(2).toLowerCase().match(/.{1,2}/g).map((value) => parseInt(value, 16));
const matches = input.substr(2).toLowerCase().match(/.{1,2}/g) || [];
return matches.map((value) => parseInt(value, 16));
} else {
return input.split('').map((char) => char.charCodeAt(0));
}

View File

@ -119,6 +119,13 @@ export default class DeployContract extends Component {
onClick={ this.onClose } />
);
const closeBtn = (
<Button
icon={ <ActionDoneAll /> }
label='Close'
onClick={ this.onClose } />
);
if (deployError) {
return cancelBtn;
}
@ -135,17 +142,10 @@ export default class DeployContract extends Component {
];
case 1:
return [
cancelBtn
];
return [ closeBtn ];
case 2:
return [
<Button
icon={ <ActionDoneAll /> }
label='Close'
onClick={ this.onClose } />
];
return [ closeBtn ];
}
}