Skip to content

Commit

Permalink
Test fix for mounting of OutPortal
Browse files Browse the repository at this point in the history
  • Loading branch information
tsullivan committed Apr 26, 2024
1 parent 2d519a2 commit 90102e9
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const BUTTON_ADD_DATA = i18n.translate('xpack.securitySolution.globalHeader.butt
*/
export const GlobalHeader = React.memo(() => {
const portalNode = useMemo(() => createHtmlPortalNode(), []);
const { setHeaderActionMenu, ...startServices } = useKibana().services;
const { theme, setHeaderActionMenu, i18n: kibanaServiceI18n } = useKibana().services;
const { pathname } = useLocation();

const getTimeline = useMemo(() => timelineSelectors.getTimelineByIdSelector(), []);
Expand All @@ -55,7 +55,10 @@ export const GlobalHeader = React.memo(() => {
useEffect(() => {
if (setHeaderActionMenu) {
setHeaderActionMenu((element) => {
const mount = toMountPoint(<OutPortal node={portalNode} />, startServices);
const mount = toMountPoint(<OutPortal node={portalNode} />, {
theme,
i18n: kibanaServiceI18n,
});
return mount(element);
});

Expand All @@ -68,7 +71,7 @@ export const GlobalHeader = React.memo(() => {
setHeaderActionMenu(undefined);
};
}
}, [portalNode, setHeaderActionMenu, dashboardViewPath, startServices]);
}, [portalNode, setHeaderActionMenu, theme, kibanaServiceI18n, dashboardViewPath]);

return (
<InPortal node={portalNode}>
Expand Down

0 comments on commit 90102e9

Please sign in to comment.