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
2 changes: 2 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,7 @@ const READ_COMMANDS = {
GET_CORPAY_ONBOARDING_FIELDS: 'GetCorpayOnboardingFields',
OPEN_WORKSPACE_PLAN_PAGE: 'OpenWorkspacePlanPage',
OPEN_SECURITY_SETTINGS_PAGE: 'OpenSecuritySettingsPage',
OPEN_TROUBLESHOOT_SETTINGS_PAGE: 'OpenTroubleshootSettingsPage',
OPEN_UNREPORTED_EXPENSES_PAGE: 'OpenUnreportedExpensesPage',
GET_GUIDE_CALL_AVAILABILITY_SCHEDULE: 'GetGuideCallAvailabilitySchedule',
GET_TRANSACTIONS_FOR_MERGING: 'GetTransactionsForMerging',
Expand Down Expand Up @@ -1280,6 +1281,7 @@ type ReadCommandParameters = {
[READ_COMMANDS.GET_CORPAY_ONBOARDING_FIELDS]: Parameters.GetCorpayOnboardingFieldsParams;
[READ_COMMANDS.OPEN_WORKSPACE_PLAN_PAGE]: Parameters.OpenWorkspacePlanPageParams;
[READ_COMMANDS.OPEN_SECURITY_SETTINGS_PAGE]: null;
[READ_COMMANDS.OPEN_TROUBLESHOOT_SETTINGS_PAGE]: null;
[READ_COMMANDS.OPEN_UNREPORTED_EXPENSES_PAGE]: Parameters.OpenUnreportedExpensesPageParams;
[READ_COMMANDS.GET_GUIDE_CALL_AVAILABILITY_SCHEDULE]: Parameters.GetGuideCallAvailabilityScheduleParams;
[READ_COMMANDS.GET_TRANSACTIONS_FOR_MERGING]: Parameters.GetTransactionsForMergingParams;
Expand Down
5 changes: 5 additions & 0 deletions src/libs/actions/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

let currentUserAccountID = -1;
let currentEmail = '';
Onyx.connect({

Check warning on line 69 in src/libs/actions/User.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
currentUserAccountID = value?.accountID ?? CONST.DEFAULT_NUMBER_ID;
Expand All @@ -75,7 +75,7 @@
});

let allPolicies: OnyxCollection<Policy>;
Onyx.connect({

Check warning on line 78 in src/libs/actions/User.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => (allPolicies = value),
Expand Down Expand Up @@ -1828,6 +1828,10 @@
Onyx.set(ONYXKEYS.FORMS.EXPENSE_RULE_FORM, ruleData);
}

function openTroubleshootSettingsPage() {
API.read(READ_COMMANDS.OPEN_TROUBLESHOOT_SETTINGS_PAGE, null);
}

function updateDraftRule(ruleData: Partial<ExpenseRuleForm>) {
Onyx.merge(ONYXKEYS.FORMS.EXPENSE_RULE_FORM, ruleData);
}
Expand Down Expand Up @@ -1899,4 +1903,5 @@
setDraftMerchantRule,
updateDraftMerchantRule,
clearDraftMerchantRule,
openTroubleshootSettingsPage,
};
7 changes: 6 additions & 1 deletion src/pages/settings/Troubleshoot/TroubleshootPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {differenceInDays} from 'date-fns';
import React, {useCallback, useMemo, useState} from 'react';
import React, {useCallback, useEffect, useMemo, useState} from 'react';
import {View} from 'react-native';
import ConfirmModal from '@components/ConfirmModal';
import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
Expand Down Expand Up @@ -28,6 +28,7 @@ import {resetExitSurveyForm} from '@libs/actions/ExitSurvey';
import {closeReactNativeApp} from '@libs/actions/HybridApp';
import {openOldDotLink} from '@libs/actions/Link';
import {setShouldMaskOnyxState} from '@libs/actions/MaskOnyx';
import {openTroubleshootSettingsPage} from '@libs/actions/User';
import ExportOnyxState from '@libs/ExportOnyxState';
import Navigation from '@libs/Navigation/Navigation';
import colors from '@styles/theme/colors';
Expand Down Expand Up @@ -165,6 +166,10 @@ function TroubleshootPage() {
.reverse();
}, [icons.Bug, icons.RotateLeft, icons.Download, waitForNavigate, exportOnyxState, shouldStoreLogs, classicRedirectMenuItem, translate, styles.sectionMenuItemTopDescription]);

useEffect(() => {
openTroubleshootSettingsPage();
}, []);

return (
<ScreenWrapper
shouldEnablePickerAvoiding={false}
Expand Down
Loading