Skip to content

Commit

Permalink
feat(theme-shared): set the visible property default value
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmet-erim committed Jul 20, 2020
1 parent 5b3886e commit c11aa24
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ export class NavItemsService {
}

addItems(items: NavItem[]) {
this._items$.next([...this.items, ...items].sort(sortItems));
this._items$.next(
[
...this.items,
...items.map(item =>
typeof item.visible === 'undefined' ? { ...item, visible: () => true } : item,
),
].sort(sortItems),
);
}

removeItem(id: string | number) {
Expand Down

0 comments on commit c11aa24

Please sign in to comment.