Skip to content

Commit

Permalink
fix(docz-theme-default): fix duplicates in search (#532) (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-dalmet authored and pedronauck committed Feb 17, 2019
1 parent 91b5f5b commit 042e54e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ class SidebarBase extends Component<SidebarProps, SidebarState> {
private match = (val: string, menu: MenuItem[]) => {
const items = menu.map(item => [item].concat(item.menu || []))
const flattened = flattendepth(items, 2)
const flattenedDeduplicated = [...(new Set(flattened))]

return match(flattened, val, { keys: ['name'] })
return match(flattenedDeduplicated, val, { keys: ['name'] })
}

private search = (initial: MenuItem[], menus: MenuItem[], val: string) => {
Expand Down

0 comments on commit 042e54e

Please sign in to comment.