Fixed error with adding new song

This commit is contained in:
Kasper Rynning-Tønnesen
2016-09-05 14:31:16 +02:00
parent c6d6270c4a
commit 1f25aaedfc
3 changed files with 10 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -90,10 +90,16 @@ var List = {
},
added_song: function(added){
now_playing = full_playlist.pop();
var now_playing;
if(full_playlist.length !== 0){
now_playing = full_playlist.pop();
}
full_playlist.push(added);
List.sortList();
full_playlist.push(now_playing);
if(now_playing){
full_playlist.push(now_playing);
}
$("#suggested-"+added.id).remove();
if(List.empty){
List.empty = false;