Add proper logic for route change

This commit is contained in:
Preston 2020-09-02 21:06:49 -04:00
parent 1bf2e51afc
commit 9b7b240de4

View File

@ -149,6 +149,28 @@ export default Vue.extend({
}
},
watch: {
$route() {
// react to route changes...
this.id = this.$route.params.id
this.isLoading = true
if (!this.usingElectron) {
this.getVideoInformationInvidious()
} else {
switch (this.backendPreference) {
case 'local':
this.getChannelInfoLocal()
this.getChannelVideosLocal()
this.getPlaylistsLocal()
break
case 'invidious':
this.getChannelInfoInvidious()
this.getPlaylistsInvidious()
break
}
}
},
videoSortBy () {
this.isElementListLoading = true
this.latestVideos = []