Skip to content

Commit 27b2de3

Browse files
committed
remove dead code from ReportActionsView
1 parent d36e0b0 commit 27b2de3

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

src/pages/inbox/report/ReportActionsView.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {useIsFocused, useRoute} from '@react-navigation/native';
1+
import {useRoute} from '@react-navigation/native';
22
import React, {useCallback, useEffect, useMemo, useRef} from 'react';
33
import type {LayoutChangeEvent} from 'react-native';
44
import ReportActionsSkeletonView from '@components/ReportActionsSkeletonView';
@@ -16,13 +16,11 @@ import usePendingConciergeResponse from '@hooks/usePendingConciergeResponse';
1616
import usePrevious from '@hooks/usePrevious';
1717
import useReportIsArchived from '@hooks/useReportIsArchived';
1818
import useReportTransactionsCollection from '@hooks/useReportTransactionsCollection';
19-
import useResponsiveLayout from '@hooks/useResponsiveLayout';
2019
import useSidePanelState from '@hooks/useSidePanelState';
2120
import useTransactionsAndViolationsForReport from '@hooks/useTransactionsAndViolationsForReport';
2221
import {getReportPreviewAction} from '@libs/actions/IOU';
2322
import {updateLoadingInitialReportAction} from '@libs/actions/Report';
2423
import DateUtils from '@libs/DateUtils';
25-
import getIsReportFullyVisible from '@libs/getIsReportFullyVisible';
2624
import {getAllNonDeletedTransactions} from '@libs/MoneyRequestReportUtils';
2725
import type {PlatformStackRouteProp} from '@libs/Navigation/PlatformStackNavigation/types';
2826
import type {ReportsSplitNavigatorParamList} from '@libs/Navigation/types';
@@ -143,10 +141,6 @@ function ReportActionsView({reportID, onLayout}: ReportActionsViewProps) {
143141
const reportPreviewAction = useMemo(() => getReportPreviewAction(report?.chatReportID, report?.reportID), [report?.chatReportID, report?.reportID]);
144142
const didLayout = useRef(false);
145143

146-
const {shouldUseNarrowLayout} = useResponsiveLayout();
147-
const isFocused = useIsFocused();
148-
const prevShouldUseNarrowLayoutRef = useRef(shouldUseNarrowLayout);
149-
const isReportFullyVisible = useMemo(() => getIsReportFullyVisible(isFocused), [isFocused]);
150144
const {transactions: reportTransactions} = useTransactionsAndViolationsForReport(reportID);
151145
const reportTransactionIDs = useMemo(
152146
() => getAllNonDeletedTransactions(reportTransactions, allReportActions ?? []).map((transaction) => transaction.transactionID),
@@ -275,12 +269,6 @@ function ReportActionsView({reportID, onLayout}: ReportActionsViewProps) {
275269
const isReportDataIncomplete = isSingleExpenseReport && isMissingTransactionThreadReportID;
276270
const isMissingReportActions = visibleReportActions.length === 0;
277271

278-
useEffect(() => {
279-
// update ref with current state
280-
prevShouldUseNarrowLayoutRef.current = shouldUseNarrowLayout;
281-
// eslint-disable-next-line react-hooks/exhaustive-deps
282-
}, [shouldUseNarrowLayout, reportActions, isReportFullyVisible]);
283-
284272
const allReportActionIDs = useMemo(() => allReportActions?.map((action) => action.reportActionID) ?? [], [allReportActions]);
285273

286274
const {loadOlderChats, loadNewerChats} = useLoadReportActions({

0 commit comments

Comments
 (0)