Displaying the graph also if tenants are not present
Prevent routes from beeing duplicated
Change-Id: Icf6967d450f32e8d80f365c1be3181e3c10c178e
diff --git a/src/app/core/services/navigation.ts b/src/app/core/services/navigation.ts
index e41333c..6fb6883 100644
--- a/src/app/core/services/navigation.ts
+++ b/src/app/core/services/navigation.ts
@@ -58,10 +58,14 @@
throw new Error('[XosNavigation] You can\'t provide both state and url');
}
+ // NOTE factor this out in a separate method an eventually use recursion since we can nest more routes
const routeExist = _.findIndex(this.routes, (r: IXosNavigationRoute) => {
if (r.label === route.label && r.state === route.state && r.parent === route.parent) {
return true;
}
+ else if (_.findIndex(r.children, route) > -1) {
+ return true;
+ }
return false;
}) > -1;