From 5ab0955048794644729151183ecaaabd2d5d73cf Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Wed, 24 Sep 2025 11:05:45 +0700 Subject: [PATCH 1/2] fix: Unapprove report modal shows up when unapproving report --- src/CONST/index.ts | 1 + src/libs/ReportUtils.ts | 8 ++++++-- src/types/onyx/OriginalMessage.ts | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 9395b1b2ea43..824cf5e30635 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -1504,6 +1504,7 @@ const CONST = { INTEGRATIONS: 'integrations', IN_APP: 'in-app', }, + EXPORT_TEMPLATE: 'exportTemplate', NEXT_STEP: { ICONS: { HOURGLASS: 'hourglass', diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index b8de6b257371..6872a8d41c59 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -11185,11 +11185,15 @@ function isExported(reportActions: OnyxEntry | ReportAction[], re const reportActionList = Array.isArray(reportActions) ? reportActions : Object.values(reportActions); for (const action of reportActionList) { if (isExportIntegrationAction(action)) { + const originalMessage = getOriginalMessage(action); // We consider any reports marked manually as exported to be exported, so we shortcut here. - if (getOriginalMessage(action)?.markedManually) { + if (originalMessage?.markedManually) { return true; } - exportIntegrationActionsCount++; + // // exportTemplate type is a CSV export, so we don't count it as an export integration action + if (originalMessage?.type !== CONST.EXPORT_TEMPLATE) { + exportIntegrationActionsCount++; + } } if (isIntegrationMessageAction(action)) { integrationMessageActionsCount++; diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 48393f41e4a0..b752735b6bdf 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -825,6 +825,11 @@ type OriginalMessageExportIntegration = { * An list of URLs to the report in the integration for out of pocket expenses */ reimbursableUrls?: string[]; + + /** + * The type of the export action + */ + type?: string; }; /** Model of `unapproved` report action */ From 00889efb375d24b35a80f4802c4368f521b3f2f8 Mon Sep 17 00:00:00 2001 From: nkdengineer <161821005+nkdengineer@users.noreply.github.com> Date: Thu, 25 Sep 2025 09:26:41 +0700 Subject: [PATCH 2/2] Update src/libs/ReportUtils.ts Co-authored-by: dukenv0307 <129500732+dukenv0307@users.noreply.github.com> --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 6872a8d41c59..0da6135c1ecb 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -11190,7 +11190,7 @@ function isExported(reportActions: OnyxEntry | ReportAction[], re if (originalMessage?.markedManually) { return true; } - // // exportTemplate type is a CSV export, so we don't count it as an export integration action + // exportTemplate type is a CSV export, so we don't count it as an export integration action if (originalMessage?.type !== CONST.EXPORT_TEMPLATE) { exportIntegrationActionsCount++; }