From f5df959548e7a2ffe1cb8c69da27302f0823ac52 Mon Sep 17 00:00:00 2001 From: Laxman Damera Date: Mon, 6 Feb 2023 20:42:42 +0530 Subject: [PATCH] Fix notification sound not playing --- source/lib/notifications-service.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/lib/notifications-service.js b/source/lib/notifications-service.js index 61d3bc7..9c799a8 100644 --- a/source/lib/notifications-service.js +++ b/source/lib/notifications-service.js @@ -118,9 +118,9 @@ export async function showNotifications(notifications) { } } -export async function playNotificationSound() { +export function playNotificationSound() { const audio = new Audio(); - audio.src = await browser.extension.getURL('/sounds/bell.ogg'); + audio.src = browser.runtime.getURL('sounds/bell.ogg'); audio.play(); } @@ -138,8 +138,8 @@ export async function checkNotifications(lastModified) { /* eslint-enable camelcase */ } - if (playNotifSound && notifications.length > 1) { - await playNotificationSound(); + if (playNotifSound && notifications.length > 0) { + playNotificationSound(); } if (showDesktopNotif) {