Skip to content

Commit 529a01b

Browse files
authored
Merge branch 'main' into feat/caip-multichain-migrate-core
2 parents fe10675 + e279dbd commit 529a01b

File tree

2 files changed

+32
-28
lines changed

2 files changed

+32
-28
lines changed

app/core/NotificationManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class NotificationManager {
145145
_showNotification = async (data) => {
146146
if (this._backgroundMode) {
147147
const { title, message } = constructTitleAndMessage(data);
148-
const id = data?.transaction?.id || '';
148+
const id = data?.transaction?.id;
149149
if (id) {
150150
this._transactionToView.push(id);
151151
}

app/util/notifications/services/NotificationService.ts

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -254,35 +254,39 @@ class NotificationsService {
254254
data?: unknown;
255255
id?: string;
256256
}): Promise<void> => {
257-
await notifee.displayNotification({
258-
id,
259-
title,
260-
body,
261-
// Notifee can only store and handle data strings
262-
data: { dataStr: JSON.stringify(data) },
263-
android: {
264-
smallIcon: 'ic_notification_small',
265-
largeIcon: 'ic_notification',
266-
channelId: channelId ?? ChannelId.DEFAULT_NOTIFICATION_CHANNEL_ID,
267-
pressAction: {
268-
id: pressActionId,
269-
launchActivity: LAUNCH_ACTIVITY,
257+
try {
258+
await notifee.displayNotification({
259+
id,
260+
title,
261+
body,
262+
// Notifee can only store and handle data strings
263+
data: { dataStr: JSON.stringify(data) },
264+
android: {
265+
smallIcon: 'ic_notification_small',
266+
largeIcon: 'ic_notification',
267+
channelId: channelId ?? ChannelId.DEFAULT_NOTIFICATION_CHANNEL_ID,
268+
pressAction: {
269+
id: pressActionId,
270+
launchActivity: LAUNCH_ACTIVITY,
271+
},
272+
tag: id,
270273
},
271-
tag: id,
272-
},
273-
ios: {
274-
launchImageName: 'Default',
275-
sound: 'default',
276-
interruptionLevel: 'critical',
277-
foregroundPresentationOptions: {
278-
alert: true,
279-
sound: true,
280-
badge: true,
281-
banner: true,
282-
list: true,
274+
ios: {
275+
launchImageName: 'Default',
276+
sound: 'default',
277+
interruptionLevel: 'critical',
278+
foregroundPresentationOptions: {
279+
alert: true,
280+
sound: true,
281+
badge: true,
282+
banner: true,
283+
list: true,
284+
},
283285
},
284-
},
285-
});
286+
});
287+
} catch (error) {
288+
Logger.log('Error displaying notification ', error);
289+
}
286290
};
287291
}
288292

0 commit comments

Comments
 (0)