Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9b022b4
feat: Add VISIBLE_REPORT_ACTIONS derived value
BartekObudzinski Feb 3, 2026
e02cfaf
feat: Enhance report action handling and last message retrieval
BartekObudzinski Feb 3, 2026
5d15693
html dm last message view
BartekObudzinski Feb 3, 2026
08677b0
fix: Update write permission check for report actions in shouldHideRe…
BartekObudzinski Feb 3, 2026
887c55c
docs: Add clarification comments for report visibility record creatio…
BartekObudzinski Feb 3, 2026
b7eee34
fix: Update shouldReportActionBeVisible to accept reports parameter f…
BartekObudzinski Feb 3, 2026
4244f95
Update logic to retrieve the last action message text to account for …
BartekObudzinski Feb 9, 2026
fd2d8b8
message retrieval logic to include money request actions and improve…
BartekObudzinski Feb 9, 2026
658d03e
fix conflicts
BartekObudzinski Feb 10, 2026
e3c65df
fix prettier
BartekObudzinski Feb 10, 2026
2da11ff
Refactor report action visibility logic to skip deprecated keys and i…
BartekObudzinski Feb 10, 2026
8140cf0
Refactor logic for retrieving last message text in reports to improve…
BartekObudzinski Feb 10, 2026
c9d13e4
Enhance message recalculation logic in LHNOptionsList and improve las…
BartekObudzinski Feb 11, 2026
a6e6606
Enhance LHNOptionsList and related utilities to improve message handl…
BartekObudzinski Feb 13, 2026
166f94a
Refactor LHNOptionsList and related utilities to streamline message h…
BartekObudzinski Feb 16, 2026
cd6457e
Add reportMetadata parameter to getOptionData function in SidebarUtils
BartekObudzinski Feb 16, 2026
9c616e4
Refactor type definitions in LHNOptionsListTest to improve type safet…
BartekObudzinski Feb 16, 2026
ae9e7b2
Enhance visibility logic for report actions by including modified exp…
BartekObudzinski Feb 17, 2026
e660915
report action visibility logic and clean up unused functions
BartekObudzinski Feb 23, 2026
b4d7ae7
prettier eslint typecheck fix
BartekObudzinski Feb 23, 2026
e86bf70
Fix post-rebase type errors
BartekObudzinski Feb 23, 2026
f64066f
Resolve conflict in UserSelectPopup — keep main's PersonalDetailOptio…
BartekObudzinski Feb 23, 2026
015c37d
fix typecheck
BartekObudzinski Feb 23, 2026
2ce6241
Merge main and fix conflicts
BartekObudzinski Feb 24, 2026
d373cbd
lint fix
BartekObudzinski Feb 24, 2026
1d9b90e
Refactor imports in LHNOptionsList component for cleaner code and add…
BartekObudzinski Feb 24, 2026
66a9a30
Refactor search options logic in ShareTab component for improved read…
BartekObudzinski Feb 24, 2026
e22d6a6
Merge main and fix conflicts
BartekObudzinski Feb 25, 2026
4aab126
Revert "Merge main and fix conflicts"
BartekObudzinski Feb 25, 2026
11d8cc0
merge main and fix conflicts v2
BartekObudzinski Feb 25, 2026
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/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,7 @@ const ONYXKEYS = {
REPORT_ATTRIBUTES: 'reportAttributes',
REPORT_TRANSACTIONS_AND_VIOLATIONS: 'reportTransactionsAndViolations',
OUTSTANDING_REPORTS_BY_POLICY_ID: 'outstandingReportsByPolicyID',
VISIBLE_REPORT_ACTIONS: 'visibleReportActions',
NON_PERSONAL_AND_WORKSPACE_CARD_LIST: 'nonPersonalAndWorkspaceCardList',
PERSONAL_AND_WORKSPACE_CARD_LIST: 'personalAndWorkspaceCardList',
CARD_FEED_ERRORS: 'cardFeedErrors',
Expand Down Expand Up @@ -1431,6 +1432,7 @@ type OnyxDerivedValuesMapping = {
[ONYXKEYS.DERIVED.REPORT_ATTRIBUTES]: OnyxTypes.ReportAttributesDerivedValue;
[ONYXKEYS.DERIVED.REPORT_TRANSACTIONS_AND_VIOLATIONS]: OnyxTypes.ReportTransactionsAndViolationsDerivedValue;
[ONYXKEYS.DERIVED.OUTSTANDING_REPORTS_BY_POLICY_ID]: OnyxTypes.OutstandingReportsByPolicyIDDerivedValue;
[ONYXKEYS.DERIVED.VISIBLE_REPORT_ACTIONS]: OnyxTypes.VisibleReportActionsDerivedValue;
[ONYXKEYS.DERIVED.NON_PERSONAL_AND_WORKSPACE_CARD_LIST]: OnyxTypes.NonPersonalAndWorkspaceCardListDerivedValue;
[ONYXKEYS.DERIVED.PERSONAL_AND_WORKSPACE_CARD_LIST]: OnyxTypes.PersonalAndWorkspaceCardListDerivedValue;
[ONYXKEYS.DERIVED.CARD_FEED_ERRORS]: OnyxTypes.CardFeedErrorsDerivedValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import type {OnyxEntry} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import type {Attachment} from '@components/Attachments/types';
import {getFileName, splitExtensionFromFileName} from '@libs/fileDownload/FileUtils';
import {getHtmlWithAttachmentID, getReportActionHtml, getReportActionMessage, getSortedReportActions, isMoneyRequestAction, shouldReportActionBeVisible} from '@libs/ReportActionsUtils';
import {getHtmlWithAttachmentID, getReportActionHtml, getReportActionMessage, getSortedReportActions, isMoneyRequestAction, isReportActionVisible} from '@libs/ReportActionsUtils';
import {canUserPerformWriteAction} from '@libs/ReportUtils';
import tryResolveUrlFromApiRoot from '@libs/tryResolveUrlFromApiRoot';
import CONST from '@src/CONST';
import type {Report, ReportAction, ReportActions} from '@src/types/onyx';
import type {Report, ReportAction, ReportActions, VisibleReportActionsDerivedValue} from '@src/types/onyx';
import type {Note} from '@src/types/onyx/Report';

/**
Expand All @@ -22,13 +22,15 @@ function extractAttachments(
reportActions,
report,
isReportArchived,
visibleReportActionsData,
}: {
privateNotes?: Record<number, Note>;
accountID?: number;
parentReportAction?: OnyxEntry<ReportAction>;
reportActions?: OnyxEntry<ReportActions>;
report: OnyxEntry<Report>;
isReportArchived: boolean | undefined;
visibleReportActionsData?: VisibleReportActionsDerivedValue;
},
) {
const targetNote = privateNotes?.[Number(accountID)]?.note ?? '';
Expand Down Expand Up @@ -115,9 +117,13 @@ function extractAttachments(
return attachments.reverse();
}

const reportID = report?.reportID;
if (!reportID) {
return attachments.reverse();
}
Comment thread
chuckdries marked this conversation as resolved.
const actions = [...(parentReportAction ? [parentReportAction] : []), ...getSortedReportActions(Object.values(reportActions ?? {}))];
for (const [key, action] of actions.entries()) {
if (!shouldReportActionBeVisible(action, key, canUserPerformAction) || isMoneyRequestAction(action)) {
for (const action of actions) {
if (!isReportActionVisible(action, reportID, canUserPerformAction, visibleReportActionsData) || isMoneyRequestAction(action)) {
continue;
}

Expand Down
70 changes: 26 additions & 44 deletions src/components/LHNOptionsList/LHNOptionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useOnyx from '@hooks/useOnyx';
import usePolicyForMovingExpenses from '@hooks/usePolicyForMovingExpenses';
import usePrevious from '@hooks/usePrevious';
import useReportAttributes from '@hooks/useReportAttributes';
import useRootNavigationState from '@hooks/useRootNavigationState';
Expand All @@ -25,15 +24,14 @@
import useThemeStyles from '@hooks/useThemeStyles';
import getPlatform from '@libs/getPlatform';
import Log from '@libs/Log';
import {getMovedReportID} from '@libs/ModifiedExpenseMessage';
import {getIOUReportIDOfLastAction, getLastMessageTextForReport} from '@libs/OptionsListUtils';
import {findLastReportActions, getOriginalMessage, isInviteOrRemovedAction, isMoneyRequestAction} from '@libs/ReportActionsUtils';
import {getIOUReportIDOfLastAction} from '@libs/OptionsListUtils';
import {getLastVisibleActionIncludingTransactionThread, getOriginalMessage, isActionableTrackExpense, isInviteOrRemovedAction, isMoneyRequestAction} from '@libs/ReportActionsUtils';
import {canUserPerformWriteAction as canUserPerformWriteActionUtil} from '@libs/ReportUtils';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import NAVIGATORS from '@src/NAVIGATORS';
import ONYXKEYS from '@src/ONYXKEYS';
import type {PersonalDetails, Report} from '@src/types/onyx';
import type {Report} from '@src/types/onyx';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import OptionRowLHNData from './OptionRowLHNData';
import OptionRowRendererComponent from './OptionRowRendererComponent';
Expand All @@ -53,7 +51,6 @@
const [reports] = useOnyx(ONYXKEYS.COLLECTION.REPORT);
const reportAttributes = useReportAttributes();
const [reportNameValuePairs] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS);
const [reportMetadataCollection] = useOnyx(ONYXKEYS.COLLECTION.REPORT_METADATA);
const [reportActions] = useOnyx(ONYXKEYS.COLLECTION.REPORT_ACTIONS);
const [policy] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST);
Expand All @@ -64,8 +61,8 @@
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [onboarding] = useOnyx(ONYXKEYS.NVP_ONBOARDING);
const [isFullscreenVisible] = useOnyx(ONYXKEYS.FULLSCREEN_VISIBILITY);
const [visibleReportActionsData] = useOnyx(ONYXKEYS.DERIVED.VISIBLE_REPORT_ACTIONS);
const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails();
const {policyForMovingExpensesID} = usePolicyForMovingExpenses();

const theme = useTheme();
const styles = useThemeStyles();
Expand Down Expand Up @@ -184,9 +181,6 @@
}
const itemInvoiceReceiverPolicy = policy?.[`${ONYXKEYS.COLLECTION.POLICY}${invoiceReceiverPolicyID}`];

const iouReportIDOfLastAction = getIOUReportIDOfLastAction(item);
const itemIouReportReportActions = iouReportIDOfLastAction ? reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReportIDOfLastAction}`] : undefined;

const itemPolicy = policy?.[`${ONYXKEYS.COLLECTION.POLICY}${item?.policyID}`];
const transactionID = isMoneyRequestAction(itemParentReportAction)
? (getOriginalMessage(itemParentReportAction)?.IOUTransactionID ?? CONST.DEFAULT_NUMBER_ID)
Expand All @@ -198,42 +192,29 @@

const isReportArchived = !!itemReportNameValuePairs?.private_isArchived;
const canUserPerformWrite = canUserPerformWriteActionUtil(item, isReportArchived);
const {lastVisibleAction: lastReportAction, lastActionForDisplay: lastAction} = findLastReportActions(itemReportActions, canUserPerformWrite);

// Get the transaction for the last report action
const lastReportActionTransactionID = isMoneyRequestAction(lastReportAction)
? (getOriginalMessage(lastReportAction)?.IOUTransactionID ?? CONST.DEFAULT_NUMBER_ID)
: CONST.DEFAULT_NUMBER_ID;
const lastAction = getLastVisibleActionIncludingTransactionThread(
reportID,
canUserPerformWrite,
reportActions,
visibleReportActionsData,
itemOneTransactionThreadReport?.reportID,
);

const iouReportIDOfLastAction = getIOUReportIDOfLastAction(item, visibleReportActionsData, lastAction);
const itemIouReportReportActions = iouReportIDOfLastAction ? reportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReportIDOfLastAction}`] : undefined;

const lastReportActionTransactionID = isMoneyRequestAction(lastAction) ? (getOriginalMessage(lastAction)?.IOUTransactionID ?? CONST.DEFAULT_NUMBER_ID) : CONST.DEFAULT_NUMBER_ID;
const lastReportActionTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${lastReportActionTransactionID}`];

// SidebarUtils.getOptionData in OptionRowLHNData does not get re-evaluated when the linked task report changes, so we have the lastMessageTextFromReport evaluation logic here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed this doen't reintroduce original bug #48285

let lastActorDetails: Partial<PersonalDetails> | null = item?.lastActorAccountID && personalDetails?.[item.lastActorAccountID] ? personalDetails[item.lastActorAccountID] : null;
if (!lastActorDetails && lastReportAction) {
const lastActorDisplayName = lastReportAction?.person?.[0]?.text;
lastActorDetails = lastActorDisplayName
? {
displayName: lastActorDisplayName,
accountID: item?.lastActorAccountID,
}
: null;
// Only override lastMessageTextFromReport when a track expense whisper's transaction has been deleted, to prevent showing stale text.
let lastMessageTextFromReport: string | undefined;
if (isActionableTrackExpense(lastAction)) {
const whisperTransactionID = getOriginalMessage(lastAction)?.transactionID;
if (whisperTransactionID && !transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${whisperTransactionID}`]) {
Comment on lines +210 to +214

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore metadata-driven LHN subtitle updates

lastMessageTextFromReport is now only overridden for the actionable track-expense case, so most rows fall back to SidebarUtils.getOptionData() without any reactive REPORT_METADATA input. That breaks update timing for subtitle branches that depend on metadata (for example getLastMessageTextForReport() checks pendingExpenseAction to show queued DEW submit/approve text), because metadata-only changes no longer trigger recomputation in LHNOptionsList, leaving stale preview text until some unrelated Onyx update re-renders the row.

Useful? React with 👍 / 👎.

Comment thread
BartekObudzinski marked this conversation as resolved.
lastMessageTextFromReport = '';
}
}
const movedFromReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${getMovedReportID(lastReportAction, CONST.REPORT.MOVE_TYPE.FROM)}`];
const movedToReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${getMovedReportID(lastReportAction, CONST.REPORT.MOVE_TYPE.TO)}`];
const chatReport = reports?.[`${ONYXKEYS.COLLECTION.REPORT}${item?.chatReportID}`];
const itemReportMetadata = reportMetadataCollection?.[`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportID}`];
const lastMessageTextFromReport = getLastMessageTextForReport({
translate,
report: item,
lastActorDetails,
movedFromReport,
movedToReport,
policy: itemPolicy,
isReportArchived: !!itemReportNameValuePairs?.private_isArchived,
policyForMovingExpensesID,
reportMetadata: itemReportMetadata,
chatReport,
reportAttributesDerived: reportAttributes,
});

const shouldShowRBRorGBRTooltip = firstReportIDWithGBRorRBR === reportID;

Expand Down Expand Up @@ -285,18 +266,16 @@
/>
);
},
[

Check warning on line 269 in src/components/LHNOptionsList/LHNOptionsList.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

React Hook useCallback has an unnecessary dependency: 'isOffline'. Either exclude it or remove the dependency array

Check warning on line 269 in src/components/LHNOptionsList/LHNOptionsList.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useCallback has an unnecessary dependency: 'isOffline'. Either exclude it or remove the dependency array
reports,
reportNameValuePairs,
reportActions,
reportMetadataCollection,
isOffline,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed

reportAttributes,
policy,
transactions,
draftComments,
personalDetails,
policyForMovingExpensesID,
firstReportIDWithGBRorRBR,
optionMode,
shouldDisableFocusOptions,
Expand All @@ -312,6 +291,7 @@
isScreenFocused,
localeCompare,
translate,
visibleReportActionsData,
currentUserAccountID,
],
);
Expand All @@ -333,6 +313,7 @@
isOffline,
isScreenFocused,
isReportsSplitNavigatorLast,
visibleReportActionsData,
],
[
reportActions,
Expand All @@ -350,6 +331,7 @@
isOffline,
isScreenFocused,
isReportsSplitNavigatorLast,
visibleReportActionsData,
],
);

Expand Down
6 changes: 3 additions & 3 deletions src/components/LHNOptionsList/OptionRowLHNData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ function OptionRowLHNData({

const [movedFromReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getMovedReportID(lastAction, CONST.REPORT.MOVE_TYPE.FROM)}`);
const [movedToReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getMovedReportID(lastAction, CONST.REPORT.MOVE_TYPE.TO)}`);
const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${fullReport?.chatReportID}`);
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
// Check the report errors equality to avoid re-rendering when there are no changes
const prevReportErrors = usePrevious(reportAttributes?.reportErrors);
Expand Down Expand Up @@ -82,7 +81,6 @@ function OptionRowLHNData({
movedFromReport,
movedToReport,
currentUserAccountID,
chatReport,
reportAttributesDerived,
});
if (deepEqual(item, optionItemRef.current)) {
Expand All @@ -94,6 +92,7 @@ function OptionRowLHNData({
return item;
// Listen parentReportAction to update title of thread report when parentReportAction changed
// Listen to transaction to update title of transaction report when transaction changed
// Listen to lastAction to update when action is deleted or gets pendingAction
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
fullReport,
Expand All @@ -115,13 +114,14 @@ function OptionRowLHNData({
invoiceReceiverPolicy,
lastMessageTextFromReport,
card,
lastAction,
lastActionReport,
translate,
localeCompare,
isReportArchived,
movedFromReport,
movedToReport,
currentUserAccountID,
chatReport,
reportAttributesDerived,
]);

Expand Down
2 changes: 1 addition & 1 deletion src/components/LHNOptionsList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ type OptionRowLHNDataProps = {
viewMode?: OptionMode;

/** The last message text from the report */
lastMessageTextFromReport: string;
lastMessageTextFromReport?: string;

/** A function that is called when an option is selected. Selected option is passed as a param */
onSelectRow?: (optionItem: OptionData, popoverAnchor: RefObject<View | null>) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
isCurrentActionUnread,
isDeletedParentAction,
isIOUActionMatchingTransactionList,
shouldReportActionBeVisible,
isReportActionVisible,
wasMessageReceivedWhileOffline,
} from '@libs/ReportActionsUtils';
import {canUserPerformWriteAction, chatIncludesChronosWithID, getOriginalReportID, getReportLastVisibleActionCreated, isHarvestCreatedExpenseReport, isUnread} from '@libs/ReportUtils';
Expand Down Expand Up @@ -186,6 +186,7 @@

const isReportArchived = useReportIsArchived(reportID);
const canPerformWriteAction = canUserPerformWriteAction(report, isReportArchived);
const [visibleReportActionsData] = useOnyx(ONYXKEYS.DERIVED.VISIBLE_REPORT_ACTIONS);

const {shouldUseNarrowLayout} = useResponsiveLayoutOnWideRHP();

Expand Down Expand Up @@ -299,7 +300,7 @@
}
return option;
});
}, [originalSelectedTransactionsOptions, dismissedRejectUseExplanation]);

Check warning on line 303 in src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

React Hook useMemo has missing dependencies: 'isDelegateAccessRestricted' and 'showDelegateNoAccessModal'. Either include them or remove the dependency array

Check warning on line 303 in src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useMemo has missing dependencies: 'isDelegateAccessRestricted' and 'showDelegateNoAccessModal'. Either include them or remove the dependency array

const dismissRejectModalBasedOnAction = useCallback(() => {
if (rejectModalAction === CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.REJECT_BULK) {
Expand All @@ -315,17 +316,29 @@
const visibleReportActions = useMemo(() => {
const filteredActions = reportActions.filter((reportAction) => {
const isActionVisibleOnMoneyReport = isActionVisibleOnMoneyRequestReport(reportAction, shouldShowHarvestCreatedAction);
if (!isActionVisibleOnMoneyReport) {
return false;
}

return (
isActionVisibleOnMoneyReport &&
(isOffline || isDeletedParentAction(reportAction) || reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || reportAction.errors) &&
shouldReportActionBeVisible(reportAction, reportAction.reportActionID, canPerformWriteAction) &&
isIOUActionMatchingTransactionList(reportAction, reportTransactionIDs)
);
const passesOfflineCheck = isOffline || isDeletedParentAction(reportAction) || reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || reportAction.errors;
if (!passesOfflineCheck) {
return false;
}

const actionReportID = reportAction.reportID ?? reportID;
if (!isReportActionVisible(reportAction, actionReportID, canPerformWriteAction, visibleReportActionsData)) {
return false;
}

if (!isIOUActionMatchingTransactionList(reportAction, reportTransactionIDs)) {
return false;
}

return true;
Comment thread
chuckdries marked this conversation as resolved.
});

return filteredActions.toReversed();
}, [reportActions, isOffline, canPerformWriteAction, reportTransactionIDs, shouldShowHarvestCreatedAction]);
}, [reportActions, isOffline, canPerformWriteAction, reportTransactionIDs, shouldShowHarvestCreatedAction, visibleReportActionsData, reportID]);

const reportActionSize = useRef(visibleReportActions.length);
const lastAction = visibleReportActions.at(-1);
Expand Down Expand Up @@ -710,7 +723,7 @@
reportScrollManager.scrollToEnd();
readActionSkipped.current = false;
readNewestAction(report.reportID);
}, [setIsFloatingMessageCounterVisible, hasNewestReportAction, reportScrollManager, report.reportID]);

Check warning on line 726 in src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

React Hook useCallback has a missing dependency: 'introSelected'. Either include it or remove the dependency array

Check warning on line 726 in src/components/MoneyRequestReportView/MoneyRequestReportActionsList.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useCallback has a missing dependency: 'introSelected'. Either include it or remove the dependency array

const scrollToNewTransaction = useCallback(
(pageY: number) => {
Expand Down
5 changes: 3 additions & 2 deletions src/components/ParentNavigationSubtitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
import {isFullScreenName} from '@libs/Navigation/helpers/isNavigatorName';
import Navigation from '@libs/Navigation/Navigation';
import type {RightModalNavigatorParamList} from '@libs/Navigation/types';
import {getReportAction, shouldReportActionBeVisible} from '@libs/ReportActionsUtils';
import {getReportAction, isReportActionVisible} from '@libs/ReportActionsUtils';
import {canUserPerformWriteAction as canUserPerformWriteActionReportUtils, isMoneyRequestReport} from '@libs/ReportUtils';
import CONST from '@src/CONST';
import type {ParentNavigationSummaryParams} from '@src/languages/params';
Expand Down Expand Up @@ -88,6 +88,7 @@ function ParentNavigationSubtitle({
const {translate} = useLocalize();
const [currentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`);
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`);
const [visibleReportActionsData] = useOnyx(ONYXKEYS.DERIVED.VISIBLE_REPORT_ACTIONS);
const isReportArchived = useReportIsArchived(report?.reportID);
const canUserPerformWriteAction = canUserPerformWriteActionReportUtils(report, isReportArchived);
const isReportInRHP = currentRoute.name === SCREENS.RIGHT_MODAL.SEARCH_REPORT;
Expand Down Expand Up @@ -116,7 +117,7 @@ function ParentNavigationSubtitle({

const onPress = () => {
const parentAction = getReportAction(parentReportID, parentReportActionID);
const isVisibleAction = shouldReportActionBeVisible(parentAction, parentAction?.reportActionID ?? CONST.DEFAULT_NUMBER_ID, canUserPerformWriteAction);
const isVisibleAction = isReportActionVisible(parentAction, parentReportID, canUserPerformWriteAction, visibleReportActionsData);

const focusedNavigatorState = currentFocusedNavigator?.state;
const currentReportIndex = focusedNavigatorState?.index;
Expand Down
Loading
Loading