From beea03fd9d51b41d4c8ef49fc86a269d5885af04 Mon Sep 17 00:00:00 2001 From: truph01 Date: Wed, 8 Jan 2025 18:19:03 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20Notification=20=E2=80=93=20Have=20no=20s?= =?UTF-8?q?ound=20for=20notification=20received?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LocalNotification/BrowserNotifications.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libs/Notification/LocalNotification/BrowserNotifications.ts b/src/libs/Notification/LocalNotification/BrowserNotifications.ts index 2a963b8bc6c9..04f45411dce1 100644 --- a/src/libs/Notification/LocalNotification/BrowserNotifications.ts +++ b/src/libs/Notification/LocalNotification/BrowserNotifications.ts @@ -6,6 +6,7 @@ import * as AppUpdate from '@libs/actions/AppUpdate'; import ModifiedExpenseMessage from '@libs/ModifiedExpenseMessage'; import {getTextFromHtml} from '@libs/ReportActionsUtils'; import * as ReportUtils from '@libs/ReportUtils'; +import playSound, {SOUNDS} from '@libs/Sound'; import type {Report, ReportAction} from '@src/types/onyx'; import focusApp from './focusApp'; import type {LocalNotificationClickHandler, LocalNotificationData} from './types'; @@ -65,9 +66,12 @@ function push( body, icon: String(icon), data, - silent, + silent: true, tag, }); + if (!silent) { + playSound(SOUNDS.RECEIVE); + } notificationCache[notificationID].onclick = () => { onClick(); window.parent.focus(); @@ -122,7 +126,7 @@ export default { reportID: report.reportID, }; - push(title, body, icon, data, onClick, true); + push(title, body, icon, data, onClick); }, pushModifiedExpenseNotification(report: Report, reportAction: ReportAction, onClick: LocalNotificationClickHandler, usesIcon = false) {