From e4e5b8f0b630c86f2fe0771f9202335829562ad0 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Thu, 7 Dec 2023 15:30:28 +0700 Subject: [PATCH] rename function --- src/libs/OptionsListUtils.js | 2 +- src/libs/ReportUtils.ts | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index c8571f4d75d2..13586b6c5d2e 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -357,7 +357,7 @@ function getAllReportErrors(report, reportActions) { if (ReportUtils.hasMissingSmartscanFields(report.reportID) && !ReportUtils.isSettled(report.reportID)) { _.extend(reportActionErrors, {smartscan: ErrorUtils.getMicroSecondOnyxError('report.genericSmartscanFailureMessage')}); } - } else if (ReportUtils.hasRequestError(_.values(reportActions))) { + } else if (ReportUtils.hasSmartscanError(_.values(reportActions))) { _.extend(reportActionErrors, {smartscan: ErrorUtils.getMicroSecondOnyxError('report.genericSmartscanFailureMessage')}); } diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index c08d74246fea..f69cce6100d6 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4269,11 +4269,9 @@ function shouldDisableWelcomeMessage(report: OnyxEntry, policy: OnyxEntr return isMoneyRequestReport(report) || isArchivedRoom(report) || !isChatRoom(report) || isChatThread(report) || !PolicyUtils.isPolicyAdmin(policy); } /** - * - * @param reportActions - * @returns + * Checks if report action has error when smart scanning */ -function hasRequestError(reportActions: ReportAction[]) { +function hasSmartscanError(reportActions: ReportAction[]) { return reportActions.some((action) => { if (!ReportActionsUtils.isSplitBillAction(action) && !ReportActionsUtils.isReportPreviewAction(action)) { return false; @@ -4486,7 +4484,7 @@ export { shouldDisableWelcomeMessage, navigateToPrivateNotes, canEditWriteCapability, - hasRequestError, + hasSmartscanError, shouldAutoFocusOnKeyPress, };