Skip to content

Commit

Permalink
Add Spotify Error
Browse files Browse the repository at this point in the history
  • Loading branch information
timoclsn committed Aug 25, 2024
1 parent 1435a46 commit 913c9f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/data/music/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export const nowPlaying = createQuery({
if (nowPlaying === null || nowPlaying.item === null) {
const recentlyPlayed = await getRecentlyPlayed();

if (!recentlyPlayed) {
throw new Error("Nothing playing and no recently played tracks");
}

const track = recentlyPlayed.track;
const artist = track.artists[0];
const image = track.album.images[0];
Expand Down

0 comments on commit 913c9f3

Please sign in to comment.