Fix title of manage hosts page UI for free version (#2467)

This commit is contained in:
gillespi314
2021-10-11 10:11:54 -05:00
committed by GitHub
parent 981028705e
commit daa8a5d31a
2 changed files with 11 additions and 10 deletions
+1
View File
@@ -0,0 +1 @@
* Fix missing default header on manage hosts page for Fleet Free version
@@ -224,14 +224,14 @@ const ManageHostsPage = ({
}
);
const { data: teams } = useQuery<ITeamsResponse, Error, ITeam[]>(
["teams"],
() => teamsAPI.loadAll(),
{
enabled: isPremiumTier,
select: (data: ITeamsResponse) => data.teams,
}
);
const { data: teams, isLoading: isLoadingTeams } = useQuery<
ITeamsResponse,
Error,
ITeam[]
>(["teams"], () => teamsAPI.loadAll(), {
enabled: !!isPremiumTier,
select: (data: ITeamsResponse) => data.teams,
});
useQuery<IPolicyAPIResponse, Error>(
["policy"],
@@ -757,7 +757,7 @@ const ManageHostsPage = ({
};
const renderTeamsFilterDropdown = () => {
if (!isPremiumTier || !teams) {
if (isPremiumTier && isLoadingTeams) {
return null;
}
@@ -766,7 +766,7 @@ const ManageHostsPage = ({
}
const teamOptions = generateTeamFilterDropdownOptions(
teams,
teams || [],
currentUser,
isOnGlobalTeam as boolean
);