Skip to content

Commit

Permalink
fix: Avoid an error log during app launch without notification
Browse files Browse the repository at this point in the history
During app launch without notification, notification id is undefined. So let's ignore this value in the comparison.
  • Loading branch information
zatteo committed Jan 16, 2024
1 parent 7796c63 commit 0e3d7b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libs/notifications/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ export const handleInitialLocalNotification = async (

const notificationId = notification?.notification.id

if (notificationId === lastLocalNotificationId) {
if (
notificationId !== undefined &&
notificationId === lastLocalNotificationId
) {
log.error(
'Received twice the same notification in handleInitialLocalNotification'
)
Expand Down

0 comments on commit 0e3d7b7

Please sign in to comment.