Require phrase confirmation. (#5731)

* Require phrase confirmation.

* Linting issues.

* Fix dialog title.

* Confirm a backup phrase.

* Confirm recovery phrase on fist run as well.
This commit is contained in:
Tomasz Drwięga
2017-06-09 12:25:14 +02:00
committed by Gav Wood
parent 06eb561af5
commit 5c3ea4ec29
7 changed files with 300 additions and 46 deletions

View File

@@ -57,6 +57,7 @@ export default class Input extends Component {
PropTypes.string,
PropTypes.bool
]),
allowPaste: PropTypes.bool,
autoFocus: PropTypes.bool,
children: PropTypes.node,
className: PropTypes.string,
@@ -97,6 +98,7 @@ export default class Input extends Component {
static defaultProps = {
allowCopy: false,
allowPaste: true,
escape: 'initial',
hideUnderline: false,
onBlur: noop,
@@ -221,6 +223,12 @@ export default class Input extends Component {
}
onChange = (event, value) => {
if (!this.props.allowPaste) {
if (value.length - this.state.value.length > 8) {
return;
}
}
event.persist();
this.setValue(value, () => {