1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-24 09:18:09 +00:00

quickfix: Pin modal - flowtype fixes + update "Learn more" link

This commit is contained in:
Szymon Lesisz 2018-10-09 13:42:36 +02:00
parent 571462f08f
commit 379522a1a7

View File

@ -40,10 +40,6 @@ const Footer = styled.div`
`; `;
class Pin extends Component<Props, State> { class Pin extends Component<Props, State> {
keyboardHandler: (event: KeyboardEvent) => void;
state: State;
constructor(props: Props) { constructor(props: Props) {
super(props); super(props);
@ -52,6 +48,15 @@ class Pin extends Component<Props, State> {
}; };
} }
componentWillMount(): void {
this.keyboardHandler = this.keyboardHandler.bind(this);
window.addEventListener('keydown', this.keyboardHandler, false);
}
componentWillUnmount(): void {
window.removeEventListener('keydown', this.keyboardHandler, false);
}
onPinAdd = (input: number): void => { onPinAdd = (input: number): void => {
let { pin } = this.state; let { pin } = this.state;
if (pin.length < 9) { if (pin.length < 9) {
@ -120,18 +125,11 @@ class Pin extends Component<Props, State> {
case 105: case 105:
this.onPinAdd(9); this.onPinAdd(9);
break; break;
default: break;
} }
} }
keyboardHandler: (event: KeyboardEvent) => void;
componentWillMount(): void {
this.keyboardHandler = this.keyboardHandler.bind(this);
window.addEventListener('keydown', this.keyboardHandler, false);
}
componentWillUnmount(): void {
window.removeEventListener('keydown', this.keyboardHandler, false);
}
render() { render() {
if (!this.props.modal.opened) return null; if (!this.props.modal.opened) return null;
@ -165,7 +163,7 @@ class Pin extends Component<Props, State> {
<StyledP isSmaller>Not sure how PIN works? <StyledP isSmaller>Not sure how PIN works?
<StyledLink <StyledLink
isGreen isGreen
href="http://doc.satoshilabs.com/trezor-user/enteringyourpin.html" href="https://wiki.trezor.io/User_manual:Entering_PIN"
target="_blank" target="_blank"
rel="noreferrer noopener" rel="noreferrer noopener"
>Learn more >Learn more