Skip to content

Commit

Permalink
fix: fixes incomplete type for player api function
Browse files Browse the repository at this point in the history
`getCurrentlyPlayingTrack` returns an empty string if no song is currently
playing. The type response of that function is incorrect, leading to
complile errors. This PR fixes the issue by correcting the type
response.

Fixes #22
  • Loading branch information
patrick-motard authored and adamgrieger committed Feb 11, 2021
1 parent 557e68b commit 6f275d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This project uses yarn. Do not
# include npm package lock.
package-lock.json

# Logs
logs
*.log
Expand Down
2 changes: 1 addition & 1 deletion src/apis/PlayerApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class PlayerApi {
*/
getCurrentlyPlayingTrack(
options?: GetCurrentlyPlayingTrackOptions,
): Promise<CurrentlyPlaying> {
): Promise<CurrentlyPlaying | string> {
return this.http.get<CurrentlyPlaying>(
'/me/player/currently-playing',
options && { params: options },
Expand Down

0 comments on commit 6f275d1

Please sign in to comment.