mirror of https://github.com/FreeTubeApp/FreeTube
Fix user playlist reversal failing after user playlist information is updated (#4947)
This commit is contained in:
parent
9e151b74bb
commit
981e8e4530
|
@ -166,13 +166,6 @@ export default defineComponent({
|
||||||
// Re-fetch from local store when current user playlist updated
|
// Re-fetch from local store when current user playlist updated
|
||||||
this.parseUserPlaylist(this.selectedUserPlaylist, { allowPlayingVideoRemoval: true })
|
this.parseUserPlaylist(this.selectedUserPlaylist, { allowPlayingVideoRemoval: true })
|
||||||
},
|
},
|
||||||
playlistItemId (newId, _oldId) {
|
|
||||||
// Playing online video
|
|
||||||
if (newId == null) { return }
|
|
||||||
|
|
||||||
// Re-fetch from local store when different item played
|
|
||||||
this.parseUserPlaylist(this.selectedUserPlaylist, { allowPlayingVideoRemoval: true })
|
|
||||||
},
|
|
||||||
videoId: function (newId, oldId) {
|
videoId: function (newId, oldId) {
|
||||||
// Check if next video is from the shuffled list or if the user clicked a different video
|
// Check if next video is from the shuffled list or if the user clicked a different video
|
||||||
if (this.shuffleEnabled) {
|
if (this.shuffleEnabled) {
|
||||||
|
@ -284,7 +277,7 @@ export default defineComponent({
|
||||||
this.reversePlaylist = !this.reversePlaylist
|
this.reversePlaylist = !this.reversePlaylist
|
||||||
// Create a new array to avoid changing array in data store state
|
// Create a new array to avoid changing array in data store state
|
||||||
// it could be user playlist or cache playlist
|
// it could be user playlist or cache playlist
|
||||||
this.playlistItems = [].concat(this.playlistItems).reverse()
|
this.playlistItems = this.playlistItems.toReversed()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
}, 1)
|
}, 1)
|
||||||
|
@ -488,6 +481,10 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.reversePlaylist) {
|
||||||
|
this.playlistItems = this.playlistItems.toReversed()
|
||||||
|
}
|
||||||
|
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue