mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
Fleet UI: Fix manage host page for invalid query strings spinner (#9198)
This commit is contained in:
parent
4f8be572f8
commit
907dfd0a7f
2 changed files with 14 additions and 3 deletions
1
changes/9129-fix-neverending-spinner
Normal file
1
changes/9129-fix-neverending-spinner
Normal file
|
|
@ -0,0 +1 @@
|
|||
- Invalid query string will not result in neverending spinner
|
||||
|
|
@ -351,7 +351,7 @@ const ManageHostsPage = ({
|
|||
}
|
||||
);
|
||||
|
||||
useQuery<IStoredPolicyResponse, Error>(
|
||||
const { isLoading: isLoadingPolicy } = useQuery<IStoredPolicyResponse, Error>(
|
||||
["policy"],
|
||||
() => globalPoliciesAPI.load(policyId),
|
||||
{
|
||||
|
|
@ -359,6 +359,9 @@ const ManageHostsPage = ({
|
|||
onSuccess: ({ policy: policyAPIResponse }) => {
|
||||
setPolicy(policyAPIResponse);
|
||||
},
|
||||
onError: () => {
|
||||
setHasHostErrors(true);
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -1647,7 +1650,14 @@ const ManageHostsPage = ({
|
|||
};
|
||||
|
||||
const renderTable = () => {
|
||||
if (!config || !currentUser || !hosts || !teamSync) {
|
||||
if (
|
||||
!config ||
|
||||
!currentUser ||
|
||||
isHostCountLoading ||
|
||||
isHostsLoading ||
|
||||
isLoadingPolicy ||
|
||||
!teamSync
|
||||
) {
|
||||
return <Spinner />;
|
||||
}
|
||||
|
||||
|
|
@ -1755,7 +1765,7 @@ const ManageHostsPage = ({
|
|||
return (
|
||||
<TableContainer
|
||||
columns={tableColumns}
|
||||
data={hosts}
|
||||
data={hosts || []}
|
||||
isLoading={isHostsLoading || isHostCountLoading}
|
||||
manualSortBy
|
||||
defaultSortHeader={(sortBy[0] && sortBy[0].key) || DEFAULT_SORT_HEADER}
|
||||
|
|
|
|||
Loading…
Reference in a new issue