Skip to content

Commit

Permalink
Fix a bug where header actions disappearing
Browse files Browse the repository at this point in the history
There was a bug where changing routes would cause the header action, in the case of Workplace Search the “Go to search application” link, to disappear on route changes.

Turns out that we didn’t need it in the useEffect and that moving it out keeps the unmount from removing the link from the header.
  • Loading branch information
scottybollinger committed Sep 30, 2020
1 parent efc9a05 commit 3254c62
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ export const WorkplaceSearchConfigured: React.FC<IInitialAppData> = (props) => {
useEffect(() => {
if (!hasInitialized) {
initializeAppData(props);
renderHeaderActions(WorkplaceSearchHeaderActions);
}
}, [hasInitialized]);

renderHeaderActions(WorkplaceSearchHeaderActions);

return (
<Switch>
<Route path={SETUP_GUIDE_PATH}>
Expand Down

0 comments on commit 3254c62

Please sign in to comment.