You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-24 23:26:50 +02:00
All: Use Lerna to manage monorepo
This commit is contained in:
24
packages/app-mobile/components/BackButtonDialogBox.ts
Normal file
24
packages/app-mobile/components/BackButtonDialogBox.ts
Normal file
@ -0,0 +1,24 @@
|
||||
const { BackButtonService } = require('../services/back-button.js');
|
||||
const DialogBox = require('react-native-dialogbox').default;
|
||||
|
||||
export default class BackButtonDialogBox extends DialogBox {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.backHandler_ = () => {
|
||||
if (this.state.isVisible) {
|
||||
this.close();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
BackButtonService.addHandler(this.backHandler_);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
BackButtonService.removeHandler(this.backHandler_);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user