diff --git a/src/libs/Notification/LocalNotification/BrowserNotifications.ts b/src/libs/Notification/LocalNotification/BrowserNotifications.ts index 8f54b8097d81..dd07ddbb5e33 100644 --- a/src/libs/Notification/LocalNotification/BrowserNotifications.ts +++ b/src/libs/Notification/LocalNotification/BrowserNotifications.ts @@ -1,9 +1,9 @@ // Web and desktop implementation only. Do not import for direct use. Use LocalNotification. -import _ from 'underscore'; import EXPENSIFY_ICON_URL from '@assets/images/expensify-logo-round-clearspace.png'; import * as ReportUtils from '@libs/ReportUtils'; import * as AppUpdate from '@userActions/AppUpdate'; import focusApp from './focusApp'; +import {PushParams, ReportCommentParams} from './types'; const DEFAULT_DELAY = 4000; @@ -112,9 +112,9 @@ export default { }); }, - pushModifiedExpenseNotification({reportAction, onClick}, usesIcon = false) { + pushModifiedExpenseNotification({reportAction, onClick}: ReportCommentParams, usesIcon = false) { push({ - title: _.map(reportAction.person, (f) => f.text).join(', '), + title: reportAction.person?.map((f) => f.text).join(', ') ?? '', body: ReportUtils.getModifiedExpenseMessage(reportAction), delay: 0, onClick, diff --git a/src/libs/Notification/LocalNotification/index.desktop.ts b/src/libs/Notification/LocalNotification/index.desktop.ts index a3e6c7289f1b..5ed6e607684c 100644 --- a/src/libs/Notification/LocalNotification/index.desktop.ts +++ b/src/libs/Notification/LocalNotification/index.desktop.ts @@ -1,5 +1,5 @@ -import BrowserNotifications from './BrowserNotifications.js'; -import {LocalNotificationModule, ReportCommentParams} from './types.js'; +import BrowserNotifications from './BrowserNotifications'; +import {LocalNotificationModule, ReportCommentParams} from './types'; function showCommentNotification({report, reportAction, onClick}: ReportCommentParams) { BrowserNotifications.pushReportCommentNotification({report, reportAction, onClick}); diff --git a/src/libs/Notification/LocalNotification/types.ts b/src/libs/Notification/LocalNotification/types.ts index 576297467155..25db8b080e2b 100644 --- a/src/libs/Notification/LocalNotification/types.ts +++ b/src/libs/Notification/LocalNotification/types.ts @@ -1,5 +1,5 @@ import {ImageSourcePropType} from 'react-native'; -import {ReportAction, Report} from '../../../types/onyx'; +import {Report, ReportAction} from '@src/types/onyx'; type PushParams = { title: string; @@ -19,6 +19,7 @@ type ReportCommentParams = { type LocalNotificationModule = { showCommentNotification: (reportCommentParams: ReportCommentParams) => void; showUpdateAvailableNotification: () => void; + showModifiedExpenseNotification: (reportCommentParams: ReportCommentParams) => void; }; export type {PushParams, ReportCommentParams, LocalNotificationModule};