Skip to content

Commit

Permalink
fix: Wrapper getBreadcrumbs not reset when menu match not found
Browse files Browse the repository at this point in the history
  • Loading branch information
shaodahong committed Sep 7, 2020
1 parent 454dfb9 commit 649f4ae
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions components/wrapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ const Wrapper: FC<WrapperProps> = ({
exact: true,
})
)
if (matchMenu) {
setState({
breadcrumbs: getMenuPaths(matchMenu, state.menus),
})
}
const breadcrumbs = matchMenu ? getMenuPaths(matchMenu, state.menus) : []
setState({
breadcrumbs,
})
}

useEffect(() => {
Expand Down

0 comments on commit 649f4ae

Please sign in to comment.