Skip to content

Commit

Permalink
watch route for changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunkyProgrammer committed Sep 10, 2024
1 parent 9eff0b1 commit 8bfeb67
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/renderer/views/Post/Post.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ export default defineComponent({
return this.backendPreference === 'invidious' || this.backendFallback
}
},
watch: {
async $route() {
// react to route changes...
this.isLoading = true
if (this.isInvidiousAllowed) {
this.id = this.$route.params.id
this.authorId = this.$route.query.authorId
await this.loadDataInvidiousAsync()
}
}
},
mounted: async function () {
if (this.isInvidiousAllowed) {
this.id = this.$route.params.id
Expand Down

0 comments on commit 8bfeb67

Please sign in to comment.