diff --git a/src/renderer/features/player/hooks/use-scrobble.ts b/src/renderer/features/player/hooks/use-scrobble.ts index 3601f3eae..2e16f67e7 100644 --- a/src/renderer/features/player/hooks/use-scrobble.ts +++ b/src/renderer/features/player/hooks/use-scrobble.ts @@ -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); }