mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Watch for route changes and change page title according to new route
This commit is contained in:
parent
b9f401cd39
commit
aad60b9db5
3 changed files with 16 additions and 4 deletions
16
src/App.vue
16
src/App.vue
|
@ -30,6 +30,22 @@ export default {
|
|||
components: {
|
||||
Navigation,
|
||||
},
|
||||
watch: {
|
||||
$route: {
|
||||
immediate: true,
|
||||
handler(to) {
|
||||
switch(to.path) {
|
||||
case "/feed":
|
||||
document.title = "Feed - Piped";
|
||||
break;
|
||||
case "/":
|
||||
document.title = "Trending - Piped";
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (window.location.pathname === "/" || window.location.pathname.length == 0)
|
||||
switch (this.getPreferenceString("homepage", "trending")) {
|
||||
|
|
|
@ -63,8 +63,6 @@ export default {
|
|||
};
|
||||
},
|
||||
mounted() {
|
||||
document.title = "Feed - Piped";
|
||||
|
||||
this.fetchFeed().then(videos => (this.videos = videos));
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -25,8 +25,6 @@ export default {
|
|||
};
|
||||
},
|
||||
mounted() {
|
||||
document.title = "Trending - Piped";
|
||||
|
||||
let region = this.getPreferenceString("region", "US");
|
||||
|
||||
this.fetchTrending(region).then(videos => (this.videos = videos));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue