Skip to content

Commit e3fd8cc

Browse files
committed
hide categorize lhn subtitle when category is disabled
1 parent 1b6cdff commit e3fd8cc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/libs/OptionsListUtils/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,14 @@ Onyx.connect({
286286
const reportNameValuePairs = allReportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${reportID}`];
287287
const isReportArchived = !!reportNameValuePairs?.private_isArchived;
288288
const isWriteActionAllowed = canUserPerformWriteAction(report, isReportArchived);
289+
const policy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`];
289290

290291
// The report is only visible if it is the last action not deleted that
291292
// does not match a closed or created state.
292293
const reportActionsForDisplay = sortedReportActions.filter(
293294
(reportAction, actionKey) =>
294295
(!(isWhisperAction(reportAction) && !isReportPreviewAction(reportAction) && !isMoneyRequestAction(reportAction)) || isActionableMentionWhisper(reportAction)) &&
295-
shouldReportActionBeVisible(reportAction, actionKey, isWriteActionAllowed) &&
296+
shouldReportActionBeVisible(reportAction, actionKey, isWriteActionAllowed, policy) &&
296297
reportAction.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED &&
297298
reportAction.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
298299
);

0 commit comments

Comments
 (0)