Skip to content

Commit 54686bb

Browse files
leshniakclaude
andcommitted
simplify pushModifiedExpenseNotification to always use getForReportActionTemp
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent dfc1df1 commit 54686bb

2 files changed

Lines changed: 15 additions & 22 deletions

File tree

src/libs/Notification/LocalNotification/BrowserNotifications.ts

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import EXPENSIFY_ICON_URL from '@assets/images/expensify-logo-round-clearspace.p
55
import * as AppUpdate from '@libs/actions/AppUpdate';
66
// eslint-disable-next-line @typescript-eslint/no-deprecated -- translateLocal is deprecated; BrowserNotifications is non-React code that cannot use the translate hook
77
import {translateLocal} from '@libs/Localize';
8-
import {getForReportAction, getForReportActionTemp} from '@libs/ModifiedExpenseMessage';
8+
import {getForReportActionTemp} from '@libs/ModifiedExpenseMessage';
99
import {getTextFromHtml} from '@libs/ReportActionsUtils';
1010
import * as ReportUtils from '@libs/ReportUtils';
1111
import playSound, {SOUNDS} from '@libs/Sound';
@@ -144,23 +144,16 @@ export default {
144144
currentUserLogin,
145145
}: LocalNotificationModifiedExpensePushParams) {
146146
const title = reportAction.person?.map((f) => f.text).join(', ') ?? '';
147-
const body = policyTags
148-
? getForReportActionTemp({
149-
// eslint-disable-next-line @typescript-eslint/no-deprecated -- translateLocal is deprecated; BrowserNotifications is non-React code that cannot use the translate hook
150-
translate: translateLocal,
151-
reportAction,
152-
policy,
153-
movedFromReport,
154-
movedToReport,
155-
policyTags,
156-
currentUserLogin,
157-
})
158-
: getForReportAction({
159-
reportAction,
160-
policyID: report.policyID,
161-
movedFromReport,
162-
movedToReport,
163-
});
147+
const body = getForReportActionTemp({
148+
// eslint-disable-next-line @typescript-eslint/no-deprecated -- translateLocal is deprecated; BrowserNotifications is non-React code that cannot use the translate hook
149+
translate: translateLocal,
150+
reportAction,
151+
policy,
152+
movedFromReport,
153+
movedToReport,
154+
policyTags,
155+
currentUserLogin,
156+
});
164157
const icon = usesIcon ? EXPENSIFY_ICON_URL : '';
165158
const data = {
166159
reportID: report.reportID,

src/libs/Notification/LocalNotification/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import BrowserNotifications from './BrowserNotifications';
66
import type {LocalNotificationClickHandler, LocalNotificationModifiedExpenseParams, LocalNotificationModule} from './types';
77

88
let allPolicies: OnyxCollection<Policy>;
9-
// We do not depend on updates on the UI for notifications, so we can use `connectWithoutView` here.
10-
// This is a temporary subscription until the modified-expense notification chain is fully migrated; see https://github.com/Expensify/App/issues/66336
9+
// This is a temporary subscription until the modified-expense notification chain is fully migrated
10+
// see https://github.com/Expensify/App/issues/66336
1111
Onyx.connectWithoutView({
1212
key: ONYXKEYS.COLLECTION.POLICY,
1313
waitForCollectionCallback: true,
@@ -17,8 +17,8 @@ Onyx.connectWithoutView({
1717
});
1818

1919
let allPolicyTags: OnyxCollection<PolicyTagLists>;
20-
// We do not depend on updates on the UI for notifications, so we can use `connectWithoutView` here.
21-
// This is a temporary subscription until the modified-expense notification chain is fully migrated; see https://github.com/Expensify/App/issues/66336
20+
// This is a temporary subscription until the modified-expense notification chain is fully migrated
21+
// see https://github.com/Expensify/App/issues/66336
2222
Onyx.connectWithoutView({
2323
key: ONYXKEYS.COLLECTION.POLICY_TAGS,
2424
waitForCollectionCallback: true,

0 commit comments

Comments
 (0)