From ed6d95cc1af01da83fe1a5e8c24f1e32b9594d58 Mon Sep 17 00:00:00 2001 From: Cilibiu Bogdan Date: Fri, 19 Oct 2018 21:51:33 +0300 Subject: [PATCH] remove extra type check (#739) --- src/app/extensions/extension.service.ts | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/app/extensions/extension.service.ts b/src/app/extensions/extension.service.ts index 96680934b..a2224fa6b 100644 --- a/src/app/extensions/extension.service.ts +++ b/src/app/extensions/extension.service.ts @@ -364,19 +364,15 @@ export class AppExtensionService implements RuleContext { .filter(action => this.filterByRules(action)) .map(action => { if (action.type === ContentActionType.menu) { - if (action.type === ContentActionType.menu) { - const copy = this.copyAction(action); - if (copy.children && copy.children.length > 0) { - copy.children = copy.children - .filter(childAction => this.filterByRules(childAction)) - .reduce(reduceSeparators, []); - } - return copy; + const copy = this.copyAction(action); + if (copy.children && copy.children.length > 0) { + copy.children = copy.children + .filter(childAction => this.filterByRules(childAction)) + .reduce(reduceSeparators, []); } - return action; - } else { - return action; + return copy; } + return action; }) .reduce(reduceEmptyMenus, []) .reduce(reduceSeparators, []);