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:
@@ -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, () => {
|
||||
|
||||
Reference in New Issue
Block a user