File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export default defineComponent({
3535 }
3636 } ,
3737 watch : {
38- async $route ( ) {
38+ async ' $route.params.id' ( ) {
3939 // react to route changes...
4040 this . isLoading = true
4141 if ( this . isInvidiousAllowed ) {
@@ -57,6 +57,18 @@ export default defineComponent({
5757 this . post = await getInvidiousCommunityPost ( this . id , this . authorId )
5858 this . authorId = this . post . authorId
5959 this . isLoading = false
60+
61+ // If the authorId is missing from the URL we should add it,
62+ // that way if the user comes back to this page by pressing the back button
63+ // we don't have to resolve the authorId again
64+ if ( this . authorId !== this . $route . query . authorId ) {
65+ this . $router . replace ( {
66+ path : `/post/${ this . id } ` ,
67+ query : {
68+ authorId : this . authorId
69+ }
70+ } )
71+ }
6072 }
6173 }
6274} )
You can’t perform that action at this time.
0 commit comments