diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index db8ac3aadaa1..16260e0edea6 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -276,6 +276,9 @@ function isReportActionDeprecated(reportAction: OnyxEntry, key: st return false; } +const {POLICYCHANGELOG: policyChangelogTypes, ROOMCHANGELOG: roomChangeLogTypes, ...otherActionTypes} = CONST.REPORT.ACTIONS.TYPE; +const supportedActionTypes: ActionName[] = [...Object.values(otherActionTypes), ...Object.values(policyChangelogTypes), ...Object.values(roomChangeLogTypes)]; + /** * Checks if a reportAction is fit for display, meaning that it's not deprecated, is of a valid * and supported type, it's not deleted and also not closed. @@ -293,9 +296,6 @@ function shouldReportActionBeVisible(reportAction: OnyxEntry, key: return false; } - const {POLICYCHANGELOG: policyChangelogTypes, ROOMCHANGELOG: roomChangeLogTypes, ...otherActionTypes} = CONST.REPORT.ACTIONS.TYPE; - const supportedActionTypes: ActionName[] = [...Object.values(otherActionTypes), ...Object.values(policyChangelogTypes), ...Object.values(roomChangeLogTypes)]; - // Filter out any unsupported reportAction types if (!supportedActionTypes.includes(reportAction.actionName)) { return false;