Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit c7adfba

Browse files
committed
Fix splash screen hang when press back
1 parent a326c9b commit c7adfba

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/view/pin-mobile.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { View, StyleSheet } from 'react-native';
2+
import { View, StyleSheet, BackHandler } from 'react-native';
33
import { observer } from 'mobx-react';
44
import PropTypes from 'prop-types';
55
import Background from '../component/background';
@@ -33,6 +33,14 @@ const styles = StyleSheet.create({
3333
class PinView extends React.Component {
3434
componentDidMount() {
3535
this.props.auth.tryFingerprint();
36+
this.backHandler = BackHandler.addEventListener(
37+
'hardwareBackPress',
38+
() => true
39+
);
40+
}
41+
42+
componentWillUnmount() {
43+
this.backHandler.remove();
3644
}
3745

3846
render() {

0 commit comments

Comments
 (0)