mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
fix drawer open
This commit is contained in:
@@ -87,29 +87,30 @@ const _moveResponder = (e) => {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let touchEndTimer = null;
|
||||||
|
|
||||||
const _handleTouch = () => {
|
const _handleTouch = () => {
|
||||||
{
|
{
|
||||||
if (currentTab === 1 && startLocation > updatedDimensions.height - 70) {
|
if (
|
||||||
|
(currentTab === 1 && startLocation > updatedDimensions.height - 70) ||
|
||||||
|
(currentTab === 0 && startLocationX < 150)
|
||||||
|
) {
|
||||||
if (currentScroll === 0 || currentScroll === 1) {
|
if (currentScroll === 0 || currentScroll === 1) {
|
||||||
tabBarRef.current?.setScrollEnabled(false);
|
tabBarRef.current?.setScrollEnabled(false);
|
||||||
}
|
}
|
||||||
} else if (currentTab === 0 && Platform.OS === 'ios') {
|
|
||||||
if (currentScroll === 0 && startLocationX < 150) {
|
|
||||||
tabBarRef.current?.setScrollEnabled(false);
|
|
||||||
} else {
|
|
||||||
tabBarRef.current?.setScrollEnabled(true);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log('blocking');
|
|
||||||
tabBarRef.current?.setScrollEnabled(true);
|
tabBarRef.current?.setScrollEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const _onTouchEnd = (e) => {
|
const _onTouchEnd = (e) => {
|
||||||
console.log('touch ended');
|
|
||||||
startLocation = 0;
|
startLocation = 0;
|
||||||
tabBarRef.current?.setScrollEnabled(true);
|
clearTimeout(touchEndTimer);
|
||||||
|
touchEndTimer = null;
|
||||||
|
touchEndTimer = setTimeout(() => {
|
||||||
|
tabBarRef.current?.setScrollEnabled(true);
|
||||||
|
}, 200);
|
||||||
};
|
};
|
||||||
|
|
||||||
const AppStack = React.memo(
|
const AppStack = React.memo(
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export const NavigationStack = ({component = NavigatorStack}) => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const onStateChange = (state) => {
|
const onStateChange = (state) => {
|
||||||
if (Platform.OS === 'android') return;
|
//if (Platform.OS === 'android') return;
|
||||||
let s = state[0];
|
let s = state[0];
|
||||||
if (s && s !== State.ACTIVE && s !== State.BEGAN) {
|
if (s && s !== State.ACTIVE && s !== State.BEGAN) {
|
||||||
let state = sideMenuRef.current.getRootState();
|
let state = sideMenuRef.current.getRootState();
|
||||||
|
|||||||
Reference in New Issue
Block a user