Skip to content

Commit

Permalink
Fix notification sound not playing (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
notlmn authored Feb 6, 2023
1 parent 8b254f3 commit 7a01849
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/lib/notifications-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -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) {
Expand Down

0 comments on commit 7a01849

Please sign in to comment.