diff --git a/src/libs/actions/Task.ts b/src/libs/actions/Task.ts index e67ad4831d40..69c0c688b652 100644 --- a/src/libs/actions/Task.ts +++ b/src/libs/actions/Task.ts @@ -23,7 +23,7 @@ import type {Icon} from '@src/types/onyx/OnyxCommon'; import type {ReportActions} from '@src/types/onyx/ReportAction'; import type ReportAction from '@src/types/onyx/ReportAction'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; -import * as Report from './Report'; +import {getMostRecentReportID, navigateToConciergeChatAndDeleteReport, notifyNewAction} from './Report'; type OptimisticReport = Pick; type Assignee = { @@ -335,7 +335,7 @@ function createTaskAndNavigate( clearOutTaskInfo(); Navigation.dismissModal(parentReportID); } - Report.notifyNewAction(parentReportID, currentUserAccountID); + notifyNewAction(parentReportID, currentUserAccountID); } /** @@ -1014,7 +1014,7 @@ function getNavigationUrlOnTaskDelete(report: OnyxEntry): stri } // If no parent report, try to navigate to most recent report - const mostRecentReportID = Report.getMostRecentReportID(report); + const mostRecentReportID = getMostRecentReportID(report); if (mostRecentReportID) { return ROUTES.REPORT_WITH_ID.getRoute(mostRecentReportID); } @@ -1162,7 +1162,7 @@ function deleteTask(report: OnyxEntry) { }; API.write(WRITE_COMMANDS.CANCEL_TASK, parameters, {optimisticData, successData, failureData}); - Report.notifyNewAction(report.reportID, currentUserAccountID); + notifyNewAction(report.reportID, currentUserAccountID); const urlToNavigateBack = getNavigationUrlOnTaskDelete(report); if (urlToNavigateBack) { @@ -1258,7 +1258,7 @@ function clearTaskErrors(reportID: string) { if (report?.pendingFields?.createChat === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) { Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID}`, report.parentReportActionID ? {[report.parentReportActionID]: null} : {}); - Report.navigateToConciergeChatAndDeleteReport(reportID); + navigateToConciergeChatAndDeleteReport(reportID); return; }