Skip to content

Commit

Permalink
Merge pull request #45697 from callstack-internal/improve-isPolicyCha…
Browse files Browse the repository at this point in the history
…ngeLogAction-performance

Improve isPolicyChangeLog performance
  • Loading branch information
dangrous authored Jul 19, 2024
2 parents b8b99d0 + 14ba6cf commit 9e811c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ const SALESFORCE_EXPENSES_URL_PREFIX = 'https://login.salesforce.com/';
*/
const QBO_EXPENSES_URL = 'https://qbo.intuit.com/app/expenses';

const POLICY_CHANGE_LOG_ARRAY = Object.values(CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG);

function isCreatedAction(reportAction: OnyxInputOrEntry<ReportAction>): boolean {
return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED;
}
Expand Down Expand Up @@ -160,7 +162,7 @@ function isModifiedExpenseAction(reportAction: OnyxInputOrEntry<ReportAction>):
}

function isPolicyChangeLogAction(reportAction: OnyxInputOrEntry<ReportAction>): reportAction is ReportAction<ValueOf<typeof CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG>> {
return isActionOfType(reportAction, ...Object.values(CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG));
return isActionOfType(reportAction, ...POLICY_CHANGE_LOG_ARRAY);
}

function isChronosOOOListAction(reportAction: OnyxInputOrEntry<ReportAction>): reportAction is ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.CHRONOS_OOO_LIST> {
Expand Down

0 comments on commit 9e811c2

Please sign in to comment.