diff --git a/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx b/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx index 74254e4e36..6dd96d9dcc 100644 --- a/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx +++ b/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx @@ -1647,18 +1647,19 @@ const ManageHostsPage = ({ ); } else if (isAllTeamsSelected && isPremiumTier) { disableRunScriptBatchTooltipContent = "Select a team to run a script"; - } else if (runScriptBatchFilterNotSupported && isAllMatchingHostsSelected) { - disableRunScriptBatchTooltipContent = - "Choose different filters to run a script"; - } else if ( - // default to blocking until count API responds - !totalFilteredHostsCount || - totalFilteredHostsCount > MAX_SCRIPT_BATCH_TARGETS - ) { - disableRunScriptBatchTooltipContent = - "Target at most 5,000 hosts to run a script"; + } else if (isAllMatchingHostsSelected) { + if (runScriptBatchFilterNotSupported) { + disableRunScriptBatchTooltipContent = + "Choose different filters to run a script"; + } else if ( + // default to blocking until count API responds + !totalFilteredHostsCount || + totalFilteredHostsCount > MAX_SCRIPT_BATCH_TARGETS + ) { + disableRunScriptBatchTooltipContent = + "Target at most 5,000 hosts to run a script"; + } } - const secondarySelectActions: IActionButtonProps[] = [ { name: "run-script",