mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-09-14 13:04:59 +00:00
Use the correct title when we're also handling redirects and scalar tokens
This commit is contained in:
parent
b7002ea4d6
commit
ebe0048710
@ -12,7 +12,6 @@ export class PageHeaderComponent {
|
|||||||
|
|
||||||
constructor(private router: Router, private activatedRoute: ActivatedRoute) {
|
constructor(private router: Router, private activatedRoute: ActivatedRoute) {
|
||||||
this.router.events.filter(ev => ev instanceof NavigationEnd).subscribe((ev: NavigationEnd) => {
|
this.router.events.filter(ev => ev instanceof NavigationEnd).subscribe((ev: NavigationEnd) => {
|
||||||
console.log(ev);
|
|
||||||
let currentRoute = this.activatedRoute.root;
|
let currentRoute = this.activatedRoute.root;
|
||||||
let url = "";
|
let url = "";
|
||||||
|
|
||||||
@ -23,8 +22,7 @@ export class PageHeaderComponent {
|
|||||||
url += "/" + route.snapshot.url.map(s => s.path).join("/");
|
url += "/" + route.snapshot.url.map(s => s.path).join("/");
|
||||||
if (route.outlet !== PRIMARY_OUTLET) return;
|
if (route.outlet !== PRIMARY_OUTLET) return;
|
||||||
if (!route.routeConfig || !route.routeConfig.data) return;
|
if (!route.routeConfig || !route.routeConfig.data) return;
|
||||||
if (url === ev.url) this.pageName = route.snapshot.data.name;
|
if (url === ev.urlAfterRedirects.split("?")[0]) this.pageName = route.snapshot.data.name;
|
||||||
console.log(url);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user