Skip to content

Commit

Permalink
Merge pull request #8935 from spadgett/4.7-fix-global-config-hotloop
Browse files Browse the repository at this point in the history
 Bug 1960686: Fix hot loop in global config page
  • Loading branch information
openshift-merge-robot committed Jun 7, 2021
2 parents dcf1720 + 0509c50 commit 0a2a645
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions frontend/public/components/cluster-settings/global-config.tsx
Expand Up @@ -57,12 +57,11 @@ const GlobalConfigPage_: React.FC<GlobalConfigPageProps & GlobalConfigPageExtens
const [textFilter, setTextFilter] = React.useState('');
const { t } = useTranslation();

const oauthMenuItems = _.map(addIDPItems, (label: string, id: string) => ({
label: t('public~{{label}}', { label }),
href: `/settings/idp/${id}`,
}));

React.useEffect(() => {
const oauthMenuItems = _.map(addIDPItems, (label: string, id: string) => ({
label: t('public~{{label}}', { label }),
href: `/settings/idp/${id}`,
}));
const editYAMLMenuItem = (name: string, resourceLink: string) => ({
label: t('global-config~Edit {{name}} resource', { name }),
href: `${resourceLink}/yaml`,
Expand Down Expand Up @@ -134,7 +133,7 @@ const GlobalConfigPage_: React.FC<GlobalConfigPageProps & GlobalConfigPageExtens
}
});
return () => (isSubscribed = false);
}, [configResources, errors, globalConfigs, oauthMenuItems, t]);
}, [configResources, globalConfigs, t]);
const visibleItems = items.filter(({ label, description = '' }) => {
return (
fuzzyCaseInsensitive(textFilter, label) ||
Expand Down

0 comments on commit 0a2a645

Please sign in to comment.