catch errors on desktop scrobble notification failure (#1723)

This commit is contained in:
jeffvli
2026-02-18 20:54:31 -08:00
parent 75af57a7b3
commit 5039012fcb
@@ -219,11 +219,20 @@ export const useScrobble = () => {
? currentSong.artists.map((artist) => artist.name).join(' · ')
: currentSong.artistName;
new Notification(`${currentSong.name}`, {
body: `${artists}\n${currentSong.album}`,
icon: imageUrlRef.current || undefined,
silent: true,
});
try {
new Notification(`${currentSong.name}`, {
body: `${artists}\n${currentSong.album}`,
icon: imageUrlRef.current || undefined,
silent: true,
});
} catch (error) {
logFn.error('an error occurred while sending a desktop notification', {
category: LogCategory.SCROBBLE,
meta: {
error: error as Error,
},
});
}
}
}, 1000);
}