Prevent fetching ML data when ML popover is opened/closed

We already fetch this data when the component is initially rendered. In
the normal workflow of page load -> open popover, we perform six (6) ML
API calls, 3 of which are redundant.

The one downside of this is that opening/closing the popover will not
refresh data; however, this workflow would previously have resulted in 6
API calls as well.
This commit is contained in:
Ryland Herrick 2021-03-11 20:41:09 -06:00
parent 1db3d4e859
commit 810b78d2b9

View file

@ -144,7 +144,6 @@ export const MlPopover = React.memo(() => {
iconSide="right"
onClick={() => {
setIsPopoverOpen(!isPopoverOpen);
dispatch({ type: 'refresh' });
}}
>
{i18n.ML_JOB_SETTINGS}