diff options
author | Florrie <towerofnix@gmail.com> | 2017-09-02 10:28:07 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2017-09-02 10:28:07 -0300 |
commit | 1bf436eecf2a04e7df1b2a6a720d6ac1712bc0bb (patch) | |
tree | 2feb71eae8befe799d60fa0c41912e2fbe20704f /src | |
parent | ea6249b614a281438638777ed58d7a2c8ecab679 (diff) |
If first track, lastTrack is null
Diffstat (limited to 'src')
-rw-r--r-- | src/pickers2.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pickers2.js b/src/pickers2.js index 53b76a8..81617a9 100644 --- a/src/pickers2.js +++ b/src/pickers2.js @@ -27,7 +27,7 @@ class HistoryManager { addNextTrackToTimeline(picker) { const lastTrack = this.timeline[this.timeline.length - 1] - this.timeline.push(this.picker(lastTrack)) + this.timeline.push(this.picker(lastTrack || null)) } fillTimeline() { @@ -68,7 +68,7 @@ const createOrderedPicker = playlist => { return lastTrack => { if (lastTrack === null) { - return flattened[0] + return flattened.items[0] } const index = flattened.items.indexOf(lastTrack) |