Browse Source

fix(theme-shared): bread crumb type error

pull/2250/head
mehmet-erim 7 years ago
parent
commit
4a2f7e1ecc
  1. 14
      npm/ng-packs/packages/theme-shared/src/lib/components/breadcrumb/breadcrumb.component.ts

14
npm/ng-packs/packages/theme-shared/src/lib/components/breadcrumb/breadcrumb.component.ts

@ -17,15 +17,17 @@ export class BreadcrumbComponent implements OnInit {
ngOnInit(): void {
this.show = !!this.store.selectSnapshot(state => state.LeptonLayoutState);
if (this.show) {
const splittedUrl = this.router.url.split('/').filter(chunk => chunk);
let splittedUrl = this.router.url.split('/').filter(chunk => chunk);
const currentUrl: ABP.FullRoute =
this.store.selectSnapshot(ConfigState.getRoute(splittedUrl[0])) ||
this.store.selectSnapshot(ConfigState.getRoute(null, null, this.router.url));
let currentUrl: ABP.FullRoute = this.store.selectSnapshot(ConfigState.getRoute(splittedUrl[0]));
if (!currentUrl) {
this.show = false;
return;
currentUrl = this.store.selectSnapshot(ConfigState.getRoute(null, null, this.router.url));
splittedUrl = [this.router.url];
if (!currentUrl) {
this.show = false;
return;
}
}
this.segments.push(currentUrl.name);

Loading…
Cancel
Save