diff --git a/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx b/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx index 0692081584..b8718cd349 100644 --- a/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx +++ b/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx @@ -498,11 +498,10 @@ const ManageHostsPage = ({ (hostsData?.hosts?.length || 0) >= hostsCount; - const handleLabelChange = ({ slug }: ILabel): boolean => { + const handleLabelChange = ({ slug, id: newLabelId }: ILabel): boolean => { const { MANAGE_HOSTS } = PATHS; - const isDeselectingLabel = - labelID && labelID === selectedLabel?.id.toString(); + const isDeselectingLabel = newLabelId && newLabelId === selectedLabel?.id; // Non-status labels are not compatible with policies or software filters // so omit policies and software params from next location