Skip to content

Commit

Permalink
DRY up notification params
Browse files Browse the repository at this point in the history
Co-authored-by: Marc Glasser <[email protected]>
  • Loading branch information
arosiclair and marcaaron authored Sep 26, 2023
1 parent b173012 commit b8791c3
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -1648,18 +1648,15 @@ function showReportActionNotification(reportID, reportAction) {
Log.info('[LocalNotification] Creating notification');
const report = allReports[reportID];

const notificationParams = {
report,
reportAction,
onClick: () => Navigation.navigate(ROUTES.getReportRoute(reportID)),
};
if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE) {
LocalNotification.showModifiedExpenseNotification({
report,
reportAction,
onClick: () => Navigation.navigate(ROUTES.getReportRoute(reportID)),
});
LocalNotification.showModifiedExpenseNotification(notificationParams);
} else {
LocalNotification.showCommentNotification({
report,
reportAction,
onClick: () => Navigation.navigate(ROUTES.getReportRoute(reportID)),
});
LocalNotification.showCommentNotification(notificationParams);
}

notifyNewAction(reportID, reportAction.actorAccountID, reportAction.reportActionID);
Expand Down

0 comments on commit b8791c3

Please sign in to comment.