Skip to content

Commit

Permalink
fix(docs): fixing routing for not githab platforms (#336)
Browse files Browse the repository at this point in the history
setNextRoute function was developed to set routing for githab due to it's 404.html problem. But it was breaking routing for others platforms, so setDefaultRoute function was written for them.
  • Loading branch information
Margar1ta authored and pimenovoleg committed Nov 11, 2019
1 parent c3057af commit 72c93ad
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,19 @@ export class MainLayoutComponent {

constructor(private router: Router,
private route: ActivatedRoute) {
const href = location.href;

this.setNextRoute();
if(href.match('github')) {
this.setNextRoute();
} else {
this.setDefaultRoute();
}
}

setDefaultRoute() {
if (location.pathname === '/') {
this.router.navigate(['button/overview'], this.extras);
}
}

setNextRoute() {
Expand All @@ -29,5 +40,4 @@ export class MainLayoutComponent {
}
localStorage.removeItem('PT_nextRoute');
}

}

0 comments on commit 72c93ad

Please sign in to comment.