Skip to content

Commit

Permalink
Merge pull request #1097 from AvonGenesis/fix-play-button-no-track
Browse files Browse the repository at this point in the history
Don't play if no track is queued
  • Loading branch information
jakejarrett committed Mar 1, 2019
2 parents 5d5a96c + 4b42fc2 commit 87928f7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/public/js/player/playerCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ app.controller('PlayerCtrl', function (
};

$scope.playPause = function ($event) {
if ($rootScope.isSongPlaying) {
playerService.pauseSong();
} else {
playerService.playSong();
}
togglePlayPause();
};

$scope.prevSong = function ($event) {
Expand Down Expand Up @@ -149,7 +145,9 @@ app.controller('PlayerCtrl', function (
* the amount of times we define it.
*/
var togglePlayPause = function () {
if ($rootScope.isSongPlaying) {
var track = queueService.getTrack();

if ($rootScope.isSongPlaying || track == null) {
playerService.pauseSong();
} else {
playerService.playSong();
Expand Down

0 comments on commit 87928f7

Please sign in to comment.