fix typescript type (#11887)

This commit is contained in:
Roberto Dip 2023-05-23 13:47:39 -03:00 committed by GitHub
parent 62e8e9e36a
commit 04ef6f13f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -10,6 +10,7 @@ const DEFAULT_HOST_MOCK: IHost = {
last_enrolled_at: "2022-01-02T12:00:00Z",
seen_time: "2022-04-06T02:11:41Z",
refetch_requested: false,
refetch_critical_queries_until: null,
hostname: "9b20fc72a247",
display_name: "9b20fc72a247",
display_text: "mock host 1",

View file

@ -203,7 +203,7 @@ export interface IHost {
last_enrolled_at: string;
seen_time: string;
refetch_requested: boolean;
refetch_critical_queries_until: string;
refetch_critical_queries_until: string | null;
hostname: string;
uuid: string;
platform: string;

View file

@ -121,6 +121,10 @@ const DeviceUserPage = ({
refetch_requested,
refetch_critical_queries_until,
}: IHost) => {
if (!refetch_critical_queries_until) {
return refetch_requested;
}
const now = new Date();
const refetchUntil = new Date(refetch_critical_queries_until);
const isRefetchingCriticalQueries =