Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/TestToolsModalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import React from 'react';
import {View} from 'react-native';
import useIsAuthenticated from '@hooks/useIsAuthenticated';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import Navigation from '@navigation/Navigation';
import {shouldShowProfileTool} from '@userActions/TestTool';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import Button from './Button';
import ClientSideLoggingToolMenu from './ClientSideLoggingToolMenu';
Expand All @@ -25,6 +27,7 @@ function TestToolsModalPage() {
const styles = useThemeStyles();
const {translate} = useLocalize();
const activeRoute = Navigation.getActiveRoute();
const [shouldStoreLogs = false] = useOnyx(ONYXKEYS.SHOULD_STORE_LOGS, {canBeMissing: true});
const isAuthenticated = useIsAuthenticated();
const route = getRouteBasedOnAuthStatus(isAuthenticated, activeRoute);

Expand All @@ -43,7 +46,7 @@ function TestToolsModalPage() {
</Text>
{shouldShowProfileTool() && <ProfilingToolMenu />}
<ClientSideLoggingToolMenu />
{!!false && (
{!!shouldStoreLogs && (
<TestToolRow title={translate('initialSettingsPage.troubleshoot.debugConsole')}>
<Button
small
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, {useCallback, useRef} from 'react';
import type {MouseEvent} from 'react';
import {View} from 'react-native';
import type {GestureResponderEvent} from 'react-native';
import NoDropZone from '@components/DragAndDrop/NoDropZone';
import FocusTrapForScreens from '@components/FocusTrap/FocusTrapForScreen';
import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback';
import TestToolsModalPage from '@components/TestToolsModalPage';
import useIsAuthenticated from '@hooks/useIsAuthenticated';
import useKeyboardShortcut from '@hooks/useKeyboardShortcut';
Expand All @@ -24,14 +24,13 @@ function TestToolsModalNavigator() {
const outerViewRef = useRef<View>(null);
const isAuthenticated = useIsAuthenticated();

const handleOuterClick = useCallback((e: MouseEvent | GestureResponderEvent) => {
e.preventDefault();
const handleOuterClick = useCallback(() => {
requestAnimationFrame(() => {
toggleTestToolsModal();
});
}, []);

const handleInnerPress = useCallback((e: GestureResponderEvent) => {
const handleInnerClick = useCallback((e: MouseEvent) => {
e.stopPropagation();
}, []);

Expand All @@ -40,16 +39,17 @@ function TestToolsModalNavigator() {
return (
<NoDropZone>
<Overlay />
<View
<PressableWithoutFeedback
ref={outerViewRef}
onClick={handleOuterClick}
onTouchEnd={handleOuterClick}
style={styles.getTestToolsNavigatorOuterView(shouldUseNarrowLayout)}
onPress={handleOuterClick}
style={[styles.getTestToolsNavigatorOuterView(shouldUseNarrowLayout), styles.cursorDefault]}
accessibilityRole="button"
accessibilityLabel="button"
>
<FocusTrapForScreens>
<View
onClick={(e) => e.stopPropagation()}
onTouchEnd={handleInnerPress}
onStartShouldSetResponder={() => true}
onClick={handleInnerClick}
style={styles.getTestToolsNavigatorInnerView(shouldUseNarrowLayout, isAuthenticated)}
>
<Stack.Navigator screenOptions={{headerShown: false}}>
Expand All @@ -60,7 +60,7 @@ function TestToolsModalNavigator() {
</Stack.Navigator>
</View>
</FocusTrapForScreens>
</View>
</PressableWithoutFeedback>
</NoDropZone>
);
}
Expand Down
Loading