mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 18:00:17 +01:00
FIX: faulty back button on viewLndInvoice screen
This commit is contained in:
parent
5d4c213e15
commit
a784c6b60b
@ -42,7 +42,7 @@ export default class LNDViewInvoice extends Component {
|
||||
qrCodeHeight: height > width ? width - 20 : width / 2,
|
||||
};
|
||||
this.fetchInvoiceInterval = undefined;
|
||||
BackHandler.addEventListener('hardwareBackPress', this.handleBackButton);
|
||||
BackHandler.addEventListener('hardwareBackPress', this.handleBackButton.bind(this));
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
@ -92,11 +92,11 @@ export default class LNDViewInvoice extends Component {
|
||||
componentWillUnmount() {
|
||||
clearInterval(this.fetchInvoiceInterval);
|
||||
this.fetchInvoiceInterval = undefined;
|
||||
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButton);
|
||||
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButton.bind(this));
|
||||
}
|
||||
|
||||
handleBackButton() {
|
||||
this.props.navigation.dismiss();
|
||||
this.props.navigation.popToTop();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -241,6 +241,6 @@ LNDViewInvoice.propTypes = {
|
||||
goBack: PropTypes.func,
|
||||
navigate: PropTypes.func,
|
||||
getParam: PropTypes.func,
|
||||
dismiss: PropTypes.func,
|
||||
popToTop: PropTypes.func,
|
||||
}),
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user