remove extra type check (#739)

This commit is contained in:
Cilibiu Bogdan
2018-10-19 21:51:33 +03:00
committed by Denys Vuika
parent 940b44663a
commit ed6d95cc1a

View File

@@ -364,19 +364,15 @@ export class AppExtensionService implements RuleContext {
.filter(action => this.filterByRules(action)) .filter(action => this.filterByRules(action))
.map(action => { .map(action => {
if (action.type === ContentActionType.menu) { if (action.type === ContentActionType.menu) {
if (action.type === ContentActionType.menu) { const copy = this.copyAction(action);
const copy = this.copyAction(action); if (copy.children && copy.children.length > 0) {
if (copy.children && copy.children.length > 0) { copy.children = copy.children
copy.children = copy.children .filter(childAction => this.filterByRules(childAction))
.filter(childAction => this.filterByRules(childAction)) .reduce(reduceSeparators, []);
.reduce(reduceSeparators, []);
}
return copy;
} }
return action; return copy;
} else {
return action;
} }
return action;
}) })
.reduce(reduceEmptyMenus, []) .reduce(reduceEmptyMenus, [])
.reduce(reduceSeparators, []); .reduce(reduceSeparators, []);