mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix backhandler
This commit is contained in:
@@ -82,6 +82,12 @@ const Editor = ({noMenu}) => {
|
|||||||
const loadNote = async item => {
|
const loadNote = async item => {
|
||||||
//EditorWebView.current?.requestFocus();
|
//EditorWebView.current?.requestFocus();
|
||||||
editing.currentlyEditing = true;
|
editing.currentlyEditing = true;
|
||||||
|
if (!DDS.isTab) {
|
||||||
|
handleBack = BackHandler.addEventListener(
|
||||||
|
'hardwareBackPress',
|
||||||
|
_onHardwareBackPress,
|
||||||
|
);
|
||||||
|
}
|
||||||
noMenu ? null : sideMenuRef.current?.setGestureEnabled(false);
|
noMenu ? null : sideMenuRef.current?.setGestureEnabled(false);
|
||||||
if (note && note.id) {
|
if (note && note.id) {
|
||||||
dispatch({type: ACTIONS.NOTES});
|
dispatch({type: ACTIONS.NOTES});
|
||||||
@@ -450,21 +456,6 @@ const Editor = ({noMenu}) => {
|
|||||||
};
|
};
|
||||||
}, [noMenu]);
|
}, [noMenu]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!DDS.isTab) {
|
|
||||||
handleBack = BackHandler.addEventListener(
|
|
||||||
'hardwareBackPress',
|
|
||||||
_onHardwareBackPress,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return () => {
|
|
||||||
if (handleBack) {
|
|
||||||
handleBack.remove();
|
|
||||||
handleBack = null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const _onBackPress = async () => {
|
const _onBackPress = async () => {
|
||||||
editing.currentlyEditing = true;
|
editing.currentlyEditing = true;
|
||||||
if (DDS.isTab) {
|
if (DDS.isTab) {
|
||||||
|
|||||||
Reference in New Issue
Block a user