Skip to content

Commit c7aa2c1

Browse files
authored
Merge pull request #57603 from nkdengineer/fix/57314
fix: tapping on attachment directs to hmm not here page
2 parents fb79730 + 9462e74 commit c7aa2c1

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

src/pages/Debug/ReportAction/DebugReportActionPage.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import ScreenWrapper from '@components/ScreenWrapper';
77
import useLocalize from '@hooks/useLocalize';
88
import useThemeStyles from '@hooks/useThemeStyles';
99
import DebugUtils from '@libs/DebugUtils';
10-
import * as DeviceCapabilities from '@libs/DeviceCapabilities';
10+
import {canUseTouchScreen} from '@libs/DeviceCapabilities';
1111
import type {DebugTabNavigatorRoutes} from '@libs/Navigation/DebugTabNavigator';
1212
import DebugTabNavigator from '@libs/Navigation/DebugTabNavigator';
1313
import Navigation from '@libs/Navigation/Navigation';
1414
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
1515
import type {DebugParamList} from '@libs/Navigation/types';
16-
import * as ReportActionsUtils from '@libs/ReportActionsUtils';
16+
import {getLinkedTransactionID} from '@libs/ReportActionsUtils';
1717
import DebugDetails from '@pages/Debug/DebugDetails';
1818
import DebugJSON from '@pages/Debug/DebugJSON';
1919
import Debug from '@userActions/Debug';
@@ -36,7 +36,7 @@ function DebugReportActionPage({
3636
canEvict: false,
3737
selector: (reportActions) => reportActions?.[reportActionID],
3838
});
39-
const transactionID = ReportActionsUtils.getLinkedTransactionID(reportAction);
39+
const transactionID = getLinkedTransactionID(reportAction);
4040

4141
const DebugDetailsTab = useCallback(
4242
() => (
@@ -73,7 +73,15 @@ function DebugReportActionPage({
7373

7474
const DebugJSONTab = useCallback(() => <DebugJSON data={reportAction ?? {}} />, [reportAction]);
7575

76-
const DebugReportActionPreviewTab = useCallback(() => <DebugReportActionPreview reportAction={reportAction} />, [reportAction]);
76+
const DebugReportActionPreviewTab = useCallback(
77+
() => (
78+
<DebugReportActionPreview
79+
reportAction={reportAction}
80+
reportID={reportID}
81+
/>
82+
),
83+
[reportAction, reportID],
84+
);
7785

7886
const routes = useMemo<DebugTabNavigatorRoutes>(
7987
() => [
@@ -88,7 +96,7 @@ function DebugReportActionPage({
8896
<ScreenWrapper
8997
includeSafeAreaPaddingBottom={false}
9098
shouldEnableKeyboardAvoidingView={false}
91-
shouldEnableMinHeight={DeviceCapabilities.canUseTouchScreen()}
99+
shouldEnableMinHeight={canUseTouchScreen()}
92100
testID={DebugReportActionPage.displayName}
93101
>
94102
{({safeAreaPaddingBottomStyle}) => (

src/pages/Debug/ReportAction/DebugReportActionPreview.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ import type {Report, ReportAction} from '@src/types/onyx';
99
type DebugReportActionPreviewProps = {
1010
/** The report action to be previewed. */
1111
reportAction: OnyxEntry<ReportAction>;
12+
13+
/** The report id to be previewed. */
14+
reportID: string;
1215
};
1316

14-
function DebugReportActionPreview({reportAction}: DebugReportActionPreviewProps) {
15-
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportAction?.reportID}`);
17+
function DebugReportActionPreview({reportAction, reportID}: DebugReportActionPreviewProps) {
18+
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`);
1619

1720
return (
1821
<ScrollView>

0 commit comments

Comments
 (0)