Skip to content

Commit

Permalink
fix: resolve types issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kubabutkiewicz committed Nov 28, 2023
1 parent 10d9574 commit 1590069
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/libs/Notification/LocalNotification/index.desktop.ts
Original file line number Diff line number Diff line change
@@ -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});
Expand Down
3 changes: 2 additions & 1 deletion src/libs/Notification/LocalNotification/types.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -19,6 +19,7 @@ type ReportCommentParams = {
type LocalNotificationModule = {
showCommentNotification: (reportCommentParams: ReportCommentParams) => void;
showUpdateAvailableNotification: () => void;
showModifiedExpenseNotification: (reportCommentParams: ReportCommentParams) => void;
};

export type {PushParams, ReportCommentParams, LocalNotificationModule};

0 comments on commit 1590069

Please sign in to comment.