Skip to content

Commit

Permalink
Fix loving/unloving tracks
Browse files Browse the repository at this point in the history
Fix a regression added in f032f92.
  • Loading branch information
alexesprit committed May 13, 2019
1 parent 1fd9564 commit cb293e6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/background/object/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ define((require) => {
* @param {Boolean} isLoved Flag indicated song is loved
*/
async toggleLove(isLoved) {
if (this.currentSong) {
await ScrobbleService.toggleLove(this.currentSong, isLoved);

this.currentSong.setLoveStatus(isLoved);
if (!this.currentSong) {
throw new Error('No song is now playing');
}
throw new Error('No song is now playing');

await ScrobbleService.toggleLove(this.currentSong, isLoved);
this.currentSong.setLoveStatus(isLoved);
}

/**
Expand Down

0 comments on commit cb293e6

Please sign in to comment.