From 725c3dd735522d501a75ddf22db8eb8570644e25 Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Sat, 22 Jun 2024 08:51:58 +0700 Subject: [PATCH 01/15] getCombinedReportActions keep filtering logic when transactionThreadReportActions not loaded --- src/libs/ReportActionsUtils.ts | 6 +----- src/libs/ReportUtils.ts | 1 - src/libs/actions/IOU.ts | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index a12e9ce61a639..37264cd7743cb 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -313,12 +313,8 @@ function shouldIgnoreGap(currentReportAction: ReportAction | undefined, nextRepo * transaction thread report in order to correctly display reportActions from both reports in the one-transaction report view. */ function getCombinedReportActions(reportActions: ReportAction[], transactionThreadReportActions: ReportAction[], reportID?: string): ReportAction[] { - if (isEmptyObject(transactionThreadReportActions)) { - return reportActions; - } - // Filter out the created action from the transaction thread report actions, since we already have the parent report's created action in `reportActions` - const filteredTransactionThreadReportActions = transactionThreadReportActions?.filter((action) => action.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED); + const filteredTransactionThreadReportActions = transactionThreadReportActions?.filter((action) => action.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED) ?? []; const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; const isSelfDM = report?.chatType === CONST.REPORT.CHAT_TYPE.SELF_DM; diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 8a30936ba33a2..f45859e5f67d4 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3263,7 +3263,6 @@ function getReportActionMessage(reportAction: ReportAction | EmptyObject, report if (ReportActionsUtils.isReimbursementQueuedAction(reportAction)) { return getReimbursementQueuedActionMessage(reportAction, getReport(reportID), false); } - return parseReportActionHtmlToText(reportAction, reportID ?? '', childReportID); } diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 9d22f2358f1ce..ab8b63fb8cc8f 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -219,7 +219,7 @@ Onyx.connect({ }, }); -let allNextSteps: NonNullable> = {}; +let allNextStpes: NonNullable> = {}; Onyx.connect({ key: ONYXKEYS.COLLECTION.NEXT_STEP, waitForCollectionCallback: true, From 2e2730a0baa27e6572fd5a106a4bc00063eef20f Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Sat, 22 Jun 2024 08:54:15 +0700 Subject: [PATCH 02/15] Revert "getCombinedReportActions keep filtering logic when transactionThreadReportActions not loaded" This reverts commit 725c3dd735522d501a75ddf22db8eb8570644e25. --- src/libs/ReportActionsUtils.ts | 6 +++++- src/libs/ReportUtils.ts | 1 + src/libs/actions/IOU.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 37264cd7743cb..a12e9ce61a639 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -313,8 +313,12 @@ function shouldIgnoreGap(currentReportAction: ReportAction | undefined, nextRepo * transaction thread report in order to correctly display reportActions from both reports in the one-transaction report view. */ function getCombinedReportActions(reportActions: ReportAction[], transactionThreadReportActions: ReportAction[], reportID?: string): ReportAction[] { + if (isEmptyObject(transactionThreadReportActions)) { + return reportActions; + } + // Filter out the created action from the transaction thread report actions, since we already have the parent report's created action in `reportActions` - const filteredTransactionThreadReportActions = transactionThreadReportActions?.filter((action) => action.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED) ?? []; + const filteredTransactionThreadReportActions = transactionThreadReportActions?.filter((action) => action.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED); const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; const isSelfDM = report?.chatType === CONST.REPORT.CHAT_TYPE.SELF_DM; diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index f45859e5f67d4..8a30936ba33a2 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3263,6 +3263,7 @@ function getReportActionMessage(reportAction: ReportAction | EmptyObject, report if (ReportActionsUtils.isReimbursementQueuedAction(reportAction)) { return getReimbursementQueuedActionMessage(reportAction, getReport(reportID), false); } + return parseReportActionHtmlToText(reportAction, reportID ?? '', childReportID); } diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index ab8b63fb8cc8f..9d22f2358f1ce 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -219,7 +219,7 @@ Onyx.connect({ }, }); -let allNextStpes: NonNullable> = {}; +let allNextSteps: NonNullable> = {}; Onyx.connect({ key: ONYXKEYS.COLLECTION.NEXT_STEP, waitForCollectionCallback: true, From 4c6d350518c42660e062041d5b523c2f0e6ca423 Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Sat, 22 Jun 2024 08:55:51 +0700 Subject: [PATCH 03/15] getCombinedReportActions keep filtering logic when transactionThreadReportActions not loaded --- src/libs/ReportActionsUtils.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index a12e9ce61a639..37264cd7743cb 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -313,12 +313,8 @@ function shouldIgnoreGap(currentReportAction: ReportAction | undefined, nextRepo * transaction thread report in order to correctly display reportActions from both reports in the one-transaction report view. */ function getCombinedReportActions(reportActions: ReportAction[], transactionThreadReportActions: ReportAction[], reportID?: string): ReportAction[] { - if (isEmptyObject(transactionThreadReportActions)) { - return reportActions; - } - // Filter out the created action from the transaction thread report actions, since we already have the parent report's created action in `reportActions` - const filteredTransactionThreadReportActions = transactionThreadReportActions?.filter((action) => action.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED); + const filteredTransactionThreadReportActions = transactionThreadReportActions?.filter((action) => action.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED) ?? []; const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; const isSelfDM = report?.chatType === CONST.REPORT.CHAT_TYPE.SELF_DM; From f09121fafca818d7832df5723db265cafd27c9ec Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Mon, 24 Jun 2024 03:17:35 +0700 Subject: [PATCH 04/15] fix issue with multiple IOU --- src/libs/ReportActionsUtils.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 97007fbdc82c0..d0cd79bcca184 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -374,13 +374,18 @@ function shouldIgnoreGap(currentReportAction: ReportAction | undefined, nextRepo * transaction thread report in order to correctly display reportActions from both reports in the one-transaction report view. */ function getCombinedReportActions(reportActions: ReportAction[], transactionThreadReportActions: ReportAction[], reportID?: string): ReportAction[] { + const nonDeletedReportActions = reportActions?.filter((action) => !isDeletedAction(action)); + + if (isEmptyObject(transactionThreadReportActions) && nonDeletedReportActions.length > 2) { + return nonDeletedReportActions; + } + // Filter out the created action from the transaction thread report actions, since we already have the parent report's created action in `reportActions` const filteredTransactionThreadReportActions = transactionThreadReportActions?.filter((action) => action.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED) ?? []; - const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; const isSelfDM = report?.chatType === CONST.REPORT.CHAT_TYPE.SELF_DM; // Filter out request and send money request actions because we don't want to show any preview actions for one transaction reports - const filteredReportActions = [...reportActions, ...filteredTransactionThreadReportActions].filter((action) => { + const filteredReportActions = [...nonDeletedReportActions, ...filteredTransactionThreadReportActions].filter((action) => { if (!isMoneyRequestAction(action)) { return true; } From 6ce37c7f7f2df20d8bbabe7c42ea3e7cceb04958 Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Tue, 25 Jun 2024 07:39:31 +0700 Subject: [PATCH 05/15] Use IOU count to show sub-report preview --- src/libs/ReportActionsUtils.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index d0cd79bcca184..d11a6a1412ccf 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -374,18 +374,20 @@ function shouldIgnoreGap(currentReportAction: ReportAction | undefined, nextRepo * transaction thread report in order to correctly display reportActions from both reports in the one-transaction report view. */ function getCombinedReportActions(reportActions: ReportAction[], transactionThreadReportActions: ReportAction[], reportID?: string): ReportAction[] { - const nonDeletedReportActions = reportActions?.filter((action) => !isDeletedAction(action)); - - if (isEmptyObject(transactionThreadReportActions) && nonDeletedReportActions.length > 2) { - return nonDeletedReportActions; + // There is a chance that transactionThreadReportActions is not loaded yet. + // We only check for emptiness when there are multiple IOUs, + // this will prevent the sub-report preview from being displayed when there is only one IOU. + const nonDeletedMoneyRequestReportActions = reportActions?.filter((action) => !isDeletedAction(action) && isMoneyRequestAction(action)); + if (isEmptyObject(transactionThreadReportActions) && nonDeletedMoneyRequestReportActions.length > 1) { + return reportActions; } - + // Filter out the created action from the transaction thread report actions, since we already have the parent report's created action in `reportActions` const filteredTransactionThreadReportActions = transactionThreadReportActions?.filter((action) => action.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED) ?? []; const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; const isSelfDM = report?.chatType === CONST.REPORT.CHAT_TYPE.SELF_DM; // Filter out request and send money request actions because we don't want to show any preview actions for one transaction reports - const filteredReportActions = [...nonDeletedReportActions, ...filteredTransactionThreadReportActions].filter((action) => { + const filteredReportActions = [...reportActions, ...filteredTransactionThreadReportActions].filter((action) => { if (!isMoneyRequestAction(action)) { return true; } From b08e4aa05d2201695e2463e91d44d4f01b447ce2 Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Tue, 25 Jun 2024 11:01:54 +0700 Subject: [PATCH 06/15] Revert unnecessary change --- src/libs/ReportActionsUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index d11a6a1412ccf..19c5ecb94858e 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -383,7 +383,7 @@ function getCombinedReportActions(reportActions: ReportAction[], transactionThre } // Filter out the created action from the transaction thread report actions, since we already have the parent report's created action in `reportActions` - const filteredTransactionThreadReportActions = transactionThreadReportActions?.filter((action) => action.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED) ?? []; + const filteredTransactionThreadReportActions = transactionThreadReportActions?.filter((action) => action.actionName !== CONST.REPORT.ACTIONS.TYPE.CREATED); const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]; const isSelfDM = report?.chatType === CONST.REPORT.CHAT_TYPE.SELF_DM; // Filter out request and send money request actions because we don't want to show any preview actions for one transaction reports From fac07edb334db6de27b8b049cc7fb7f8f777b7a0 Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Wed, 26 Jun 2024 04:40:12 +0700 Subject: [PATCH 07/15] Use transactionThreadReportID instead of recounting IOU --- src/libs/ReportActionsUtils.ts | 10 +++++++--- src/pages/home/report/ReportActionsView.tsx | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 4b04e5a6dc6ef..e46e260027bd3 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -374,12 +374,16 @@ function shouldIgnoreGap(currentReportAction: ReportAction | undefined, nextRepo * Returns a sorted and filtered list of report actions from a report and it's associated child * transaction thread report in order to correctly display reportActions from both reports in the one-transaction report view. */ -function getCombinedReportActions(reportActions: ReportAction[], transactionThreadReportActions: ReportAction[], reportID?: string): ReportAction[] { +function getCombinedReportActions( + reportActions: ReportAction[], + transactionThreadReportActions: ReportAction[], + reportID?: string, + transactionThreadReportID?: string | null, +): ReportAction[] { // There is a chance that transactionThreadReportActions is not loaded yet. // We only check for emptiness when there are multiple IOUs, // this will prevent the sub-report preview from being displayed when there is only one IOU. - const nonDeletedMoneyRequestReportActions = reportActions?.filter((action) => !isDeletedAction(action) && isMoneyRequestAction(action)); - if (isEmptyObject(transactionThreadReportActions) && nonDeletedMoneyRequestReportActions.length > 1) { + if (isEmptyObject(transactionThreadReportActions) && _.isEmpty(transactionThreadReportID)) { return reportActions; } diff --git a/src/pages/home/report/ReportActionsView.tsx b/src/pages/home/report/ReportActionsView.tsx index 5c42f4a6cccd4..d4b85d783f8d2 100755 --- a/src/pages/home/report/ReportActionsView.tsx +++ b/src/pages/home/report/ReportActionsView.tsx @@ -96,6 +96,7 @@ function ReportActionsView({ isLoadingNewerReportActions = false, hasLoadingNewerReportActionsError = false, isReadyForCommentLinking = false, + transactionThreadReportID, }: ReportActionsViewProps) { useCopySelectionHelper(); const reactionListRef = useContext(ReactionListContext); @@ -157,8 +158,8 @@ function ReportActionsView({ // Get a sorted array of reportActions for both the current report and the transaction thread report associated with this report (if there is one) // so that we display transaction-level and report-level report actions in order in the one-transaction view const combinedReportActions = useMemo( - () => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportActions), - [allReportActions, transactionThreadReportActions], + () => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportActions, reportID, transactionThreadReportID), + [allReportActions, transactionThreadReportActions, transactionThreadReportID], ); const parentReportActionForTransactionThread = useMemo( From 8fc183122153fb936254f1004baddf10f88e618a Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Wed, 26 Jun 2024 05:11:56 +0700 Subject: [PATCH 08/15] missing dependency --- src/pages/home/report/ReportActionsView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsView.tsx b/src/pages/home/report/ReportActionsView.tsx index d4b85d783f8d2..d0b8d30fa4c5f 100755 --- a/src/pages/home/report/ReportActionsView.tsx +++ b/src/pages/home/report/ReportActionsView.tsx @@ -159,7 +159,7 @@ function ReportActionsView({ // so that we display transaction-level and report-level report actions in order in the one-transaction view const combinedReportActions = useMemo( () => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportActions, reportID, transactionThreadReportID), - [allReportActions, transactionThreadReportActions, transactionThreadReportID], + [allReportActions, transactionThreadReportActions, transactionThreadReportID, reportID], ); const parentReportActionForTransactionThread = useMemo( From 778b3e374ae2394f33a0960ab5e4808612bc5cab Mon Sep 17 00:00:00 2001 From: Wildan M Date: Wed, 26 Jun 2024 11:04:52 +0700 Subject: [PATCH 09/15] Update src/pages/home/report/ReportActionsView.tsx Co-authored-by: Pujan Shah --- src/pages/home/report/ReportActionsView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsView.tsx b/src/pages/home/report/ReportActionsView.tsx index d0b8d30fa4c5f..362a2d086ed8e 100755 --- a/src/pages/home/report/ReportActionsView.tsx +++ b/src/pages/home/report/ReportActionsView.tsx @@ -158,7 +158,7 @@ function ReportActionsView({ // Get a sorted array of reportActions for both the current report and the transaction thread report associated with this report (if there is one) // so that we display transaction-level and report-level report actions in order in the one-transaction view const combinedReportActions = useMemo( - () => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportActions, reportID, transactionThreadReportID), + () => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportID, transactionThreadReportActions), [allReportActions, transactionThreadReportActions, transactionThreadReportID, reportID], ); From b316c2abc8e43650b0d150501faa2b83f6cfa282 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Wed, 26 Jun 2024 11:06:34 +0700 Subject: [PATCH 10/15] Update src/libs/ReportActionsUtils.ts Co-authored-by: Pujan Shah --- src/libs/ReportActionsUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index e46e260027bd3..38a8be5b8e36f 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -376,9 +376,9 @@ function shouldIgnoreGap(currentReportAction: ReportAction | undefined, nextRepo */ function getCombinedReportActions( reportActions: ReportAction[], + transactionThreadReportID: string | null, transactionThreadReportActions: ReportAction[], reportID?: string, - transactionThreadReportID?: string | null, ): ReportAction[] { // There is a chance that transactionThreadReportActions is not loaded yet. // We only check for emptiness when there are multiple IOUs, From 8381d0bfc280fe37bdb1d449eb23440169f632db Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Wed, 26 Jun 2024 11:09:50 +0700 Subject: [PATCH 11/15] Add transactionThreadReportID to getCombinedReportActions --- src/libs/OptionsListUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index 077fb5b72102d..d03d3cbba0cc4 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -298,7 +298,7 @@ Onyx.connect({ const transactionThreadReportID = ReportActionUtils.getOneTransactionThreadReportID(reportID, actions[reportActions[0]]); if (transactionThreadReportID) { const transactionThreadReportActionsArray = Object.values(actions[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`] ?? {}); - sortedReportActions = ReportActionUtils.getCombinedReportActions(reportActionsArray, transactionThreadReportActionsArray, reportID); + sortedReportActions = ReportActionUtils.getCombinedReportActions(reportActionsArray, transactionThreadReportID, transactionThreadReportActionsArray, reportID); } lastReportActions[reportID] = sortedReportActions[0]; From 9a247c3673e1c8d8d24d94f3b95fe64ad25dc226 Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Wed, 26 Jun 2024 11:23:06 +0700 Subject: [PATCH 12/15] change transactionThreadReportID to mandatory --- src/pages/home/report/ReportActionsView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsView.tsx b/src/pages/home/report/ReportActionsView.tsx index 362a2d086ed8e..e5571a02b67a1 100755 --- a/src/pages/home/report/ReportActionsView.tsx +++ b/src/pages/home/report/ReportActionsView.tsx @@ -158,7 +158,7 @@ function ReportActionsView({ // Get a sorted array of reportActions for both the current report and the transaction thread report associated with this report (if there is one) // so that we display transaction-level and report-level report actions in order in the one-transaction view const combinedReportActions = useMemo( - () => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportID, transactionThreadReportActions), + () => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportID ?? null, transactionThreadReportActions, reportID), [allReportActions, transactionThreadReportActions, transactionThreadReportID, reportID], ); From 23507b9ff6ac831b8d321fb4ff17ff18f062ed12 Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Wed, 26 Jun 2024 14:02:08 +0700 Subject: [PATCH 13/15] remove reportID in ReportActionViews' getCombinedReportActions --- src/pages/home/report/ReportActionsView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsView.tsx b/src/pages/home/report/ReportActionsView.tsx index e5571a02b67a1..e0a68ab6fa72f 100755 --- a/src/pages/home/report/ReportActionsView.tsx +++ b/src/pages/home/report/ReportActionsView.tsx @@ -158,7 +158,7 @@ function ReportActionsView({ // Get a sorted array of reportActions for both the current report and the transaction thread report associated with this report (if there is one) // so that we display transaction-level and report-level report actions in order in the one-transaction view const combinedReportActions = useMemo( - () => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportID ?? null, transactionThreadReportActions, reportID), + () => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportID ?? null, transactionThreadReportActions), [allReportActions, transactionThreadReportActions, transactionThreadReportID, reportID], ); From 8a89228f7eb0592bb74f32a78b8a9a27c9e8a67e Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Wed, 26 Jun 2024 14:02:53 +0700 Subject: [PATCH 14/15] remove unnecessary dependency --- src/pages/home/report/ReportActionsView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsView.tsx b/src/pages/home/report/ReportActionsView.tsx index e0a68ab6fa72f..6629d9267d1b9 100755 --- a/src/pages/home/report/ReportActionsView.tsx +++ b/src/pages/home/report/ReportActionsView.tsx @@ -159,7 +159,7 @@ function ReportActionsView({ // so that we display transaction-level and report-level report actions in order in the one-transaction view const combinedReportActions = useMemo( () => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportID ?? null, transactionThreadReportActions), - [allReportActions, transactionThreadReportActions, transactionThreadReportID, reportID], + [allReportActions, transactionThreadReportActions, transactionThreadReportID], ); const parentReportActionForTransactionThread = useMemo( From 6778162d86adca8fc543339f15e616934b9e22a0 Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Wed, 26 Jun 2024 16:47:26 +0700 Subject: [PATCH 15/15] remove unnecessarcy check --- src/libs/ReportActionsUtils.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 38a8be5b8e36f..8e7633b59e6ea 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -380,10 +380,7 @@ function getCombinedReportActions( transactionThreadReportActions: ReportAction[], reportID?: string, ): ReportAction[] { - // There is a chance that transactionThreadReportActions is not loaded yet. - // We only check for emptiness when there are multiple IOUs, - // this will prevent the sub-report preview from being displayed when there is only one IOU. - if (isEmptyObject(transactionThreadReportActions) && _.isEmpty(transactionThreadReportID)) { + if (_.isEmpty(transactionThreadReportID)) { return reportActions; }