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 { ngOnInit(): void {
this.show = !!this.store.selectSnapshot(state => state.LeptonLayoutState); this.show = !!this.store.selectSnapshot(state => state.LeptonLayoutState);
if (this.show) { 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 = let currentUrl: ABP.FullRoute = this.store.selectSnapshot(ConfigState.getRoute(splittedUrl[0]));
this.store.selectSnapshot(ConfigState.getRoute(splittedUrl[0])) ||
this.store.selectSnapshot(ConfigState.getRoute(null, null, this.router.url));
if (!currentUrl) { if (!currentUrl) {
this.show = false; currentUrl = this.store.selectSnapshot(ConfigState.getRoute(null, null, this.router.url));
return; splittedUrl = [this.router.url];
if (!currentUrl) {
this.show = false;
return;
}
} }
this.segments.push(currentUrl.name); this.segments.push(currentUrl.name);

Loading…
Cancel
Save