! Fix unable to view another playlist when already in playlist view (#1211)
This commit is contained in:
parent
2752006179
commit
e4e3090153
|
@ -7,7 +7,7 @@ import FtListVideo from '../../components/ft-list-video/ft-list-video.vue'
|
||||||
import FtFlexBox from '../../components/ft-flex-box/ft-flex-box.vue'
|
import FtFlexBox from '../../components/ft-flex-box/ft-flex-box.vue'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
name: 'Search',
|
name: 'Playlist',
|
||||||
components: {
|
components: {
|
||||||
'ft-loader': FtLoader,
|
'ft-loader': FtLoader,
|
||||||
'ft-card': FtCard,
|
'ft-card': FtCard,
|
||||||
|
@ -40,37 +40,25 @@ export default Vue.extend({
|
||||||
watch: {
|
watch: {
|
||||||
$route () {
|
$route () {
|
||||||
// react to route changes...
|
// react to route changes...
|
||||||
const payload = {
|
this.getPlaylist()
|
||||||
query: this.$route.params.query,
|
|
||||||
options: {},
|
|
||||||
nextPage: false
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof (this.sessionSearchHistory[this.query]) !== 'undefined' && this.query !== this.$route.params.query) {
|
|
||||||
this.isLoading = true
|
|
||||||
this.shownResults = []
|
|
||||||
// Replacing the data right away causes a strange error where the data
|
|
||||||
// Shown is mixed from 2 different search results. So we'll wait a moment
|
|
||||||
// Before showing the results.
|
|
||||||
setTimeout(this.replaceShownResults, 100, this.sessionSearchHistory[this.query])
|
|
||||||
} else {
|
|
||||||
this.performSearch(payload)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.playlistId = this.$route.params.id
|
this.getPlaylist()
|
||||||
|
|
||||||
switch (this.backendPreference) {
|
|
||||||
case 'local':
|
|
||||||
this.getPlaylistLocal()
|
|
||||||
break
|
|
||||||
case 'invidious':
|
|
||||||
this.getPlaylistInvidious()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getPlaylist: function () {
|
||||||
|
this.playlistId = this.$route.params.id
|
||||||
|
|
||||||
|
switch (this.backendPreference) {
|
||||||
|
case 'local':
|
||||||
|
this.getPlaylistLocal()
|
||||||
|
break
|
||||||
|
case 'invidious':
|
||||||
|
this.getPlaylistInvidious()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
},
|
||||||
getPlaylistLocal: function () {
|
getPlaylistLocal: function () {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue