Skip to content

Commit 62b0bcc

Browse files
committed
Merge pull request #714 from Soundnode/fix-707
keep current track playing when a track is removed from the queue. closes #707
2 parents 311381f + 2646f5b commit 62b0bcc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/public/js/common/queueService.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,14 @@ app.factory('queueService', function() {
166166
}
167167

168168
this.list.splice(position, 1);
169+
170+
// keep current playing track in the same position
171+
// after a track removed from the list
172+
if ( this.currentPosition > position ) {
173+
this.currentPosition = --this.currentPosition;
174+
} else if ( this.currentPosition < position ) {
175+
this.currentPosition = this.currentPosition++;
176+
}
169177
};
170178

171179
// expose Queue for debugging ONLY

0 commit comments

Comments
 (0)