diff --git a/src/Expensify.tsx b/src/Expensify.tsx
index e446f1e725a9..5696fdffeaca 100644
--- a/src/Expensify.tsx
+++ b/src/Expensify.tsx
@@ -12,9 +12,12 @@ import GrowlNotification from './components/GrowlNotification';
import RequireTwoFactorAuthenticationModal from './components/RequireTwoFactorAuthenticationModal';
import AppleAuthWrapper from './components/SignInButtons/AppleAuthWrapper';
import SplashScreenHider from './components/SplashScreenHider';
+import TestToolsModal from './components/TestToolsModal';
import UpdateAppModal from './components/UpdateAppModal';
import * as CONFIG from './CONFIG';
import CONST from './CONST';
+import useDebugShortcut from './hooks/useDebugShortcut';
+import useIsAuthenticated from './hooks/useIsAuthenticated';
import useLocalize from './hooks/useLocalize';
import {updateLastRoute} from './libs/actions/App';
import * as EmojiPickerAction from './libs/actions/EmojiPickerAction';
@@ -96,6 +99,8 @@ function Expensify() {
const [focusModeNotification] = useOnyx(ONYXKEYS.FOCUS_MODE_NOTIFICATION, {initWithStoredValues: false});
const [lastVisitedPath] = useOnyx(ONYXKEYS.LAST_VISITED_PATH);
+ useDebugShortcut();
+
useEffect(() => {
if (!account?.needsTwoFactorAuthSetup || account.requiresTwoFactorAuth) {
return;
@@ -112,7 +117,7 @@ function Expensify() {
setAttemptedToOpenPublicRoom(true);
}, [isCheckingPublicRoom]);
- const isAuthenticated = useMemo(() => !!(session?.authToken ?? null), [session]);
+ const isAuthenticated = useIsAuthenticated();
const autoAuthState = useMemo(() => session?.autoAuthState ?? '', [session]);
const shouldInit = isNavigationReady && hasAttemptedToOpenPublicRoom;
@@ -295,6 +300,7 @@ function Expensify() {
/>
)}
{shouldHideSplash && }
+
);
}
diff --git a/src/ROUTES.ts b/src/ROUTES.ts
index 1974f9851a88..e7d6990db8d5 100644
--- a/src/ROUTES.ts
+++ b/src/ROUTES.ts
@@ -268,7 +268,7 @@ const ROUTES = {
SETTINGS_STATUS_CLEAR_AFTER_DATE: 'settings/profile/status/clear-after/date',
SETTINGS_STATUS_CLEAR_AFTER_TIME: 'settings/profile/status/clear-after/time',
SETTINGS_TROUBLESHOOT: 'settings/troubleshoot',
- SETTINGS_CONSOLE: {
+ CONSOLE_DEBUG: {
route: 'settings/troubleshoot/console',
getRoute: (backTo?: string) => getUrlWithBackToParam(`settings/troubleshoot/console`, backTo),
},
diff --git a/src/SCREENS.ts b/src/SCREENS.ts
index d950fb1cd5db..7c32387244a2 100644
--- a/src/SCREENS.ts
+++ b/src/SCREENS.ts
@@ -62,6 +62,7 @@ const SCREENS = {
ADVANCED_FILTERS_IN_RHP: 'Search_Advanced_Filters_In_RHP',
TRANSACTION_HOLD_REASON_RHP: 'Search_Transaction_Hold_Reason_RHP',
},
+ CONSOLE_DEBUG: 'Console_Debug',
SETTINGS: {
ROOT: 'Settings_Root',
SHARE_CODE: 'Settings_Share_Code',
@@ -77,7 +78,6 @@ const SCREENS = {
CLOSE: 'Settings_Close',
REPORT_CARD_LOST_OR_DAMAGED: 'Settings_ReportCardLostOrDamaged',
TROUBLESHOOT: 'Settings_Troubleshoot',
- CONSOLE: 'Settings_Console',
SHARE_LOG: 'Share_Log',
PROFILE: {
diff --git a/src/components/TestToolMenu.tsx b/src/components/TestToolMenu.tsx
index 83aba3d4b61e..8d8c3bc4dc89 100644
--- a/src/components/TestToolMenu.tsx
+++ b/src/components/TestToolMenu.tsx
@@ -1,11 +1,12 @@
import React from 'react';
import {useOnyx} from 'react-native-onyx';
+import useIsAuthenticated from '@hooks/useIsAuthenticated';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
-import * as ApiUtils from '@libs/ApiUtils';
-import * as Network from '@userActions/Network';
-import * as Session from '@userActions/Session';
-import * as User from '@userActions/User';
+import {isUsingStagingApi} from '@libs/ApiUtils';
+import {setShouldFailAllRequests, setShouldForceOffline, setShouldSimulatePoorConnection} from '@userActions/Network';
+import {expireSessionWithDelay, invalidateAuthToken, invalidateCredentials} from '@userActions/Session';
+import {setIsDebugModeEnabled, setShouldUseStagingServer} from '@userActions/User';
import CONFIG from '@src/CONFIG';
import ONYXKEYS from '@src/ONYXKEYS';
import type {User as UserOnyx} from '@src/types/onyx';
@@ -28,11 +29,14 @@ function TestToolMenu() {
const [network] = useOnyx(ONYXKEYS.NETWORK);
const [user = USER_DEFAULT] = useOnyx(ONYXKEYS.USER);
const [isUsingImportedState] = useOnyx(ONYXKEYS.IS_USING_IMPORTED_STATE);
- const shouldUseStagingServer = user?.shouldUseStagingServer ?? ApiUtils.isUsingStagingApi();
+ const shouldUseStagingServer = user?.shouldUseStagingServer ?? isUsingStagingApi();
const isDebugModeEnabled = !!user?.isDebugModeEnabled;
const styles = useThemeStyles();
const {translate} = useLocalize();
+ // Check if the user is authenticated to show options that require authentication
+ const isAuthenticated = useIsAuthenticated();
+
return (
<>
{translate('initialSettingsPage.troubleshoot.testingPreferences')}
- {/* When toggled the app will be put into debug mode. */}
-
- User.setIsDebugModeEnabled(!isDebugModeEnabled)}
- />
-
+ {isAuthenticated && (
+ <>
+ {/* When toggled the app will be put into debug mode. */}
+
+ setIsDebugModeEnabled(!isDebugModeEnabled)}
+ />
+
+
+ {/* Instantly invalidates a user's local authToken. Useful for testing flows related to reauthentication. */}
+
+
+
+ {/* Invalidate stored user auto-generated credentials. Useful for manually testing sign out logic. */}
+
+
+
+ {/* Sends an expired session to the FE and invalidates the session by the same time in the BE. Action is delayed for 15s */}
+
+
+ >
+ )}
{/* Option to switch between staging and default api endpoints.
This enables QA, internal testers and external devs to take advantage of sandbox environments for 3rd party services like Plaid and Onfido.
@@ -58,7 +93,7 @@ function TestToolMenu() {
User.setShouldUseStagingServer(!shouldUseStagingServer)}
+ onToggle={() => setShouldUseStagingServer(!shouldUseStagingServer)}
/>
)}
@@ -68,7 +103,7 @@ function TestToolMenu() {
Network.setShouldForceOffline(!network?.shouldForceOffline)}
+ onToggle={() => setShouldForceOffline(!network?.shouldForceOffline)}
disabled={!!isUsingImportedState || !!network?.shouldSimulatePoorConnection || network?.shouldFailAllRequests}
/>
@@ -78,7 +113,7 @@ function TestToolMenu() {
Network.setShouldSimulatePoorConnection(!network?.shouldSimulatePoorConnection, network?.poorConnectionTimeoutID)}
+ onToggle={() => setShouldSimulatePoorConnection(!network?.shouldSimulatePoorConnection, network?.poorConnectionTimeoutID)}
disabled={!!isUsingImportedState || !!network?.shouldFailAllRequests || network?.shouldForceOffline}
/>
@@ -88,38 +123,10 @@ function TestToolMenu() {
Network.setShouldFailAllRequests(!network?.shouldFailAllRequests)}
+ onToggle={() => setShouldFailAllRequests(!network?.shouldFailAllRequests)}
disabled={!!network?.shouldForceOffline || network?.shouldSimulatePoorConnection}
/>
-
- {/* Instantly invalidates a user's local authToken. Useful for testing flows related to reauthentication. */}
-
-
-
- {/* Invalidate stored user auto-generated credentials. Useful for manually testing sign out logic. */}
-
-
-
- {/* Sends an expired session to the FE and invalidates the session by the same time in the BE. Action is delayed for 15s */}
-
-
-
>
);
diff --git a/src/components/TestToolsModal.tsx b/src/components/TestToolsModal.tsx
index 7c2e161b2d11..cd5222e6728f 100644
--- a/src/components/TestToolsModal.tsx
+++ b/src/components/TestToolsModal.tsx
@@ -48,7 +48,7 @@ function TestToolsModal() {
text={translate('initialSettingsPage.debugConsole.viewConsole')}
onPress={() => {
toggleTestToolsModal();
- Navigation.navigate(ROUTES.SETTINGS_CONSOLE.getRoute(Navigation.getActiveRoute()));
+ Navigation.navigate(ROUTES.CONSOLE_DEBUG.getRoute(Navigation.getActiveRoute()));
}}
/>
diff --git a/src/hooks/useDebugShortcut.ts b/src/hooks/useDebugShortcut.ts
new file mode 100644
index 000000000000..38b2abccce0c
--- /dev/null
+++ b/src/hooks/useDebugShortcut.ts
@@ -0,0 +1,26 @@
+import {useEffect} from 'react';
+import KeyboardShortcut from '@libs/KeyboardShortcut';
+import toggleTestToolsModal from '@userActions/TestTool';
+import CONST from '@src/CONST';
+
+function useDebugShortcut() {
+ useEffect(() => {
+ const debugShortcutConfig = CONST.KEYBOARD_SHORTCUTS.DEBUG;
+ const unsubscribeDebugShortcut = KeyboardShortcut.subscribe(
+ debugShortcutConfig.shortcutKey,
+ () => toggleTestToolsModal(),
+ debugShortcutConfig.descriptionKey,
+ debugShortcutConfig.modifiers,
+ true,
+ );
+
+ return () => {
+ unsubscribeDebugShortcut();
+ };
+
+ // Rule disabled because this effect is only for component did mount & will component unmount lifecycle event
+ // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
+ }, []);
+}
+
+export default useDebugShortcut;
diff --git a/src/hooks/useIsAuthenticated.ts b/src/hooks/useIsAuthenticated.ts
new file mode 100644
index 000000000000..cfca734f9b86
--- /dev/null
+++ b/src/hooks/useIsAuthenticated.ts
@@ -0,0 +1,11 @@
+import {useMemo} from 'react';
+import {useOnyx} from 'react-native-onyx';
+import ONYXKEYS from '@src/ONYXKEYS';
+
+function useIsAuthenticated() {
+ const [session] = useOnyx(ONYXKEYS.SESSION);
+ const isAuthenticated = useMemo(() => !!(session?.authToken ?? null), [session]);
+ return isAuthenticated;
+}
+
+export default useIsAuthenticated;
diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx
index 4ed6f22f3f3b..7d4f674d8e2b 100644
--- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx
+++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx
@@ -11,7 +11,6 @@ import OptionsListContextProvider from '@components/OptionListContextProvider';
import {SearchContextProvider} from '@components/Search/SearchContext';
import {useSearchRouterContext} from '@components/Search/SearchRouter/SearchRouterContext';
import SearchRouterModal from '@components/Search/SearchRouter/SearchRouterModal';
-import TestToolsModal from '@components/TestToolsModal';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useOnboardingFlowRouter from '@hooks/useOnboardingFlow';
import {ReportIDsContextProvider} from '@hooks/useReportIDs';
@@ -45,7 +44,6 @@ import * as PersonalDetails from '@userActions/PersonalDetails';
import * as PriorityMode from '@userActions/PriorityMode';
import * as Report from '@userActions/Report';
import * as Session from '@userActions/Session';
-import toggleTestToolsModal from '@userActions/TestTool';
import * as User from '@userActions/User';
import CONFIG from '@src/CONFIG';
import CONST from '@src/CONST';
@@ -248,7 +246,6 @@ function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDApplie
const shortcutsOverviewShortcutConfig = CONST.KEYBOARD_SHORTCUTS.SHORTCUTS;
const searchShortcutConfig = CONST.KEYBOARD_SHORTCUTS.SEARCH;
const chatShortcutConfig = CONST.KEYBOARD_SHORTCUTS.NEW_CHAT;
- const debugShortcutConfig = CONST.KEYBOARD_SHORTCUTS.DEBUG;
const currentUrl = getCurrentUrl();
const isLoggingInAsNewUser = !!session?.email && SessionUtils.isLoggingInAsNewUser(currentUrl, session.email);
// Sign out the current user if we're transitioning with a different user
@@ -364,21 +361,12 @@ function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDApplie
true,
);
- const unsubscribeDebugShortcut = KeyboardShortcut.subscribe(
- debugShortcutConfig.shortcutKey,
- () => toggleTestToolsModal(),
- debugShortcutConfig.descriptionKey,
- debugShortcutConfig.modifiers,
- true,
- );
-
return () => {
unsubscribeEscapeKey();
unsubscribeOnyxModal();
unsubscribeShortcutsOverviewShortcut();
unsubscribeSearchShortcut();
unsubscribeChatShortcut();
- unsubscribeDebugShortcut();
Session.cleanupSession();
};
@@ -627,7 +615,6 @@ function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDApplie
component={ConnectionCompletePage}
/>
-
diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx
index 2058a317aa2b..fc468320f3bc 100644
--- a/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx
+++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx
@@ -3,6 +3,7 @@ import React from 'react';
import createPlatformStackNavigator from '@libs/Navigation/PlatformStackNavigation/createPlatformStackNavigator';
import type {
AddPersonalBankAccountNavigatorParamList,
+ ConsoleNavigatorParamList,
DebugParamList,
EditRequestNavigatorParamList,
EnablePaymentsNavigatorParamList,
@@ -226,6 +227,10 @@ const NewTeachersUniteNavigator = createModalStackNavigator require('../../../../pages/TeachersUnite/ImTeacherPage').default,
});
+const ConsoleModalStackNavigator = createModalStackNavigator({
+ [SCREENS.CONSOLE_DEBUG]: () => require('../../../../pages/settings/AboutPage/ConsolePage').default,
+});
+
const SettingsModalStackNavigator = createModalStackNavigator({
[SCREENS.SETTINGS.SHARE_CODE]: () => require('../../../../pages/ShareCodePage').default,
[SCREENS.SETTINGS.PROFILE.PRONOUNS]: () => require('../../../../pages/settings/Profile/PronounsPage').default,
@@ -247,7 +252,7 @@ const SettingsModalStackNavigator = createModalStackNavigator require('../../../../pages/settings/Preferences/ThemePage').default,
[SCREENS.SETTINGS.CLOSE]: () => require('../../../../pages/settings/Security/CloseAccountPage').default,
[SCREENS.SETTINGS.APP_DOWNLOAD_LINKS]: () => require('../../../../pages/settings/AppDownloadLinks').default,
- [SCREENS.SETTINGS.CONSOLE]: () => require('../../../../pages/settings/AboutPage/ConsolePage').default,
+ [SCREENS.CONSOLE_DEBUG]: () => require('../../../../pages/settings/AboutPage/ConsolePage').default,
[SCREENS.SETTINGS.SHARE_LOG]: () => require('../../../../pages/settings/AboutPage/ShareLogPage').default,
[SCREENS.SETTINGS.WALLET.CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS]: () => require('../../../../pages/settings/Profile/PersonalDetails/PersonalAddressPage').default,
[SCREENS.SETTINGS.WALLET.DOMAIN_CARD]: () => require('../../../../pages/settings/Wallet/ExpensifyCardPage').default,
@@ -761,4 +766,5 @@ export {
MissingPersonalDetailsModalStackNavigator,
DebugModalStackNavigator,
WorkspaceConfirmationModalStackNavigator,
+ ConsoleModalStackNavigator,
};
diff --git a/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx
index b1d923c69b29..b7c3a612ea6d 100644
--- a/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx
+++ b/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx
@@ -2,6 +2,7 @@ import type {StackCardInterpolationProps} from '@react-navigation/stack';
import React, {useMemo, useRef} from 'react';
import {InteractionManager, View} from 'react-native';
import NoDropZone from '@components/DragAndDrop/NoDropZone';
+import useIsAuthenticated from '@hooks/useIsAuthenticated';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
import {abandonReviewDuplicateTransactions} from '@libs/actions/Transaction';
@@ -29,6 +30,7 @@ function RightModalNavigator({navigation, route}: RightModalNavigatorProps) {
const isExecutingRef = useRef(false);
const customInterpolator = useModalCardStyleInterpolator();
const modalNavigatorOptions = useSideModalStackScreenOptions();
+ const isAuthenticated = useIsAuthenticated();
const screenOptions = useMemo(() => {
// The .forHorizontalIOS interpolator from `@react-navigation` is misbehaving on Safari, so we override it with Expensify custom interpolator
@@ -84,151 +86,160 @@ function RightModalNavigator({navigation, route}: RightModalNavigatorProps) {
id={NAVIGATORS.RIGHT_MODAL_NAVIGATOR}
>
- {
- InteractionManager.runAfterInteractions(clearTwoFactorAuthData);
- },
- }}
- />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ {isAuthenticated && (
+ <>
+
+ {
+ InteractionManager.runAfterInteractions(clearTwoFactorAuthData);
+ },
+ }}
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ )}
diff --git a/src/libs/Navigation/AppNavigator/PublicScreens.tsx b/src/libs/Navigation/AppNavigator/PublicScreens.tsx
index 77e379e80293..82f3d3340dcc 100644
--- a/src/libs/Navigation/AppNavigator/PublicScreens.tsx
+++ b/src/libs/Navigation/AppNavigator/PublicScreens.tsx
@@ -14,6 +14,7 @@ import ValidateLoginPage from '@pages/ValidateLoginPage';
import NAVIGATORS from '@src/NAVIGATORS';
import SCREENS from '@src/SCREENS';
import defaultScreenOptions from './defaultScreenOptions';
+import RightModalNavigator from './Navigators/RightModalNavigator';
const RootStack = createPlatformStackNavigator();
@@ -59,6 +60,10 @@ function PublicScreens() {
name={SCREENS.SAML_SIGN_IN}
component={SAMLSignInPage}
/>
+
);
}
diff --git a/src/libs/Navigation/linkingConfig/RELATIONS/SETTINGS_TO_RHP.ts b/src/libs/Navigation/linkingConfig/RELATIONS/SETTINGS_TO_RHP.ts
index 6e306eb7cba6..7a22cd6756b6 100755
--- a/src/libs/Navigation/linkingConfig/RELATIONS/SETTINGS_TO_RHP.ts
+++ b/src/libs/Navigation/linkingConfig/RELATIONS/SETTINGS_TO_RHP.ts
@@ -50,7 +50,7 @@ const CENTRAL_PANE_TO_RHP_MAPPING: Partial['config'] = {
},
},
},
+
[NAVIGATORS.RIGHT_MODAL_NAVIGATOR]: {
screens: {
+ [SCREENS.CONSOLE_DEBUG]: {
+ path: ROUTES.CONSOLE_DEBUG.route,
+ exact: true,
+ },
[SCREENS.RIGHT_MODAL.SETTINGS]: {
screens: {
[SCREENS.SETTINGS.PREFERENCES.PRIORITY_MODE]: {
@@ -215,10 +220,6 @@ const config: LinkingOptions['config'] = {
path: ROUTES.SETTINGS_APP_DOWNLOAD_LINKS,
exact: true,
},
- [SCREENS.SETTINGS.CONSOLE]: {
- path: ROUTES.SETTINGS_CONSOLE.route,
- exact: true,
- },
[SCREENS.SETTINGS.SHARE_LOG]: ROUTES.SETTINGS_SHARE_LOG.route,
[SCREENS.SETTINGS.PROFILE.CONTACT_METHODS]: {
path: ROUTES.SETTINGS_CONTACT_METHODS.route,
diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts
index 98ea3606e6c1..f76f935014d5 100644
--- a/src/libs/Navigation/types.ts
+++ b/src/libs/Navigation/types.ts
@@ -74,6 +74,10 @@ type BackToAndForwardToParms = {
forwardTo?: Routes;
};
+type ConsoleNavigatorParamList = {
+ [SCREENS.CONSOLE_DEBUG]: undefined;
+};
+
type SettingsNavigatorParamList = {
[SCREENS.SETTINGS.SHARE_CODE]: undefined;
[SCREENS.SETTINGS.PROFILE.PRONOUNS]: undefined;
@@ -105,7 +109,7 @@ type SettingsNavigatorParamList = {
[SCREENS.SETTINGS.PREFERENCES.THEME]: undefined;
[SCREENS.SETTINGS.CLOSE]: undefined;
[SCREENS.SETTINGS.APP_DOWNLOAD_LINKS]: undefined;
- [SCREENS.SETTINGS.CONSOLE]: {
+ [SCREENS.CONSOLE_DEBUG]: {
backTo: Routes;
};
[SCREENS.SETTINGS.SHARE_LOG]: {
@@ -1530,6 +1534,7 @@ type RightModalNavigatorParamList = {
[SCREENS.RIGHT_MODAL.SEARCH_SAVED_SEARCH]: NavigatorScreenParams;
[SCREENS.RIGHT_MODAL.MISSING_PERSONAL_DETAILS]: NavigatorScreenParams;
[SCREENS.RIGHT_MODAL.DEBUG]: NavigatorScreenParams;
+ [SCREENS.CONSOLE_DEBUG]: NavigatorScreenParams;
};
type TravelNavigatorParamList = {
@@ -1745,6 +1750,7 @@ type PublicScreensParamList = SharedScreensParamList & {
[SCREENS.SAML_SIGN_IN]: undefined;
[SCREENS.CONNECTION_COMPLETE]: undefined;
[SCREENS.BANK_CONNECTION_COMPLETE]: undefined;
+ [NAVIGATORS.RIGHT_MODAL_NAVIGATOR]: NavigatorScreenParams;
};
type AuthScreensParamList = SharedScreensParamList & {
@@ -1959,4 +1965,5 @@ export type {
MigratedUserModalNavigatorParamList,
WorkspaceConfirmationNavigatorParamList,
TwoFactorAuthNavigatorParamList,
+ ConsoleNavigatorParamList,
};
diff --git a/src/pages/settings/AboutPage/ConsolePage.tsx b/src/pages/settings/AboutPage/ConsolePage.tsx
index 75792df40a23..6ef72c592f79 100644
--- a/src/pages/settings/AboutPage/ConsolePage.tsx
+++ b/src/pages/settings/AboutPage/ConsolePage.tsx
@@ -14,6 +14,7 @@ import type {PopoverMenuItem} from '@components/PopoverMenu';
import ScreenWrapper from '@components/ScreenWrapper';
import Text from '@components/Text';
import TextInput from '@components/TextInput';
+import useIsAuthenticated from '@hooks/useIsAuthenticated';
import useKeyboardShortcut from '@hooks/useKeyboardShortcut';
import useLocalize from '@hooks/useLocalize';
import useTheme from '@hooks/useTheme';
@@ -50,7 +51,8 @@ function ConsolePage() {
const styles = useThemeStyles();
const theme = useTheme();
const {windowWidth} = useWindowDimensions();
- const route = useRoute>();
+ const route = useRoute>();
+ const isAuthenticated = useIsAuthenticated();
const menuItems: PopoverMenuItem[] = useMemo(
() => [
@@ -181,14 +183,16 @@ function ConsolePage() {
icon={Expensicons.Download}
style={[styles.flex1, styles.mr1]}
/>
-
+ {isAuthenticated && (
+
+ )}
{
- ReportActions.searchInServer(debouncedSearchValue);
+ searchInServer(debouncedSearchValue);
}, [debouncedSearchValue]);
return (
@@ -117,7 +113,7 @@ function BaseShareLogList({onAttachLogToReport}: BaseShareLogListProps) {
<>
Navigation.goBack(ROUTES.SETTINGS_CONSOLE.getRoute())}
+ onBackButtonPress={() => Navigation.goBack(ROUTES.CONSOLE_DEBUG.getRoute())}
/>
Navigation.navigate(ROUTES.SETTINGS_CONSOLE.getRoute(ROUTES.SETTINGS_TROUBLESHOOT))),
+ action: waitForNavigate(() => Navigation.navigate(ROUTES.CONSOLE_DEBUG.getRoute(ROUTES.SETTINGS_TROUBLESHOOT))),
};
const baseMenuItems: BaseMenuItem[] = [
@@ -126,7 +126,7 @@ function TroubleshootPage() {
{translate('initialSettingsPage.troubleshoot.description')}{' '}
Report.navigateToConciergeChat()}
+ onPress={() => navigateToConciergeChat()}
>
{translate('initialSettingsPage.troubleshoot.submitBug')}