Fix UI bug in OS settings modal that caused status tooltip to flicker when refetching host details (#36099)

This commit is contained in:
Sarah Gillespie 2025-11-20 18:06:54 -06:00 committed by GitHub
parent 65234043f8
commit b7f1f479e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 12 deletions

2
changes/25787-ui-bugfix Normal file
View file

@ -0,0 +1,2 @@
- Fixed UI bug in OS settings modal that caused status tooltip to flicker when refetching host
details.

View file

@ -541,12 +541,12 @@ const DeviceUserPage = ({
setSelectedCertificate(certificate);
};
const resendProfile = (profileUUID: string): Promise<void> => {
if (!host) {
return new Promise(() => undefined);
}
return deviceUserAPI.resendProfile(deviceAuthToken, profileUUID);
};
const resendProfile = useCallback(
(profileUUID: string): Promise<void> => {
return deviceUserAPI.resendProfile(deviceAuthToken, profileUUID);
},
[deviceAuthToken]
);
const renderDeviceUserPage = () => {
const failingPoliciesCount = host?.issues?.failing_policies_count || 0;

View file

@ -669,12 +669,15 @@ const HostDetailsPage = ({
}
};
const resendProfile = (profileUUID: string): Promise<void> => {
if (!host) {
return new Promise(() => undefined);
}
return hostAPI.resendProfile(host.id, profileUUID);
};
const resendProfile = useCallback(
(profileUUID: string): Promise<void> => {
if (!host?.id) {
return new Promise(() => undefined);
}
return hostAPI.resendProfile(host.id, profileUUID);
},
[host?.id]
);
const onChangeActivityTab = (tabIndex: number) => {
setActiveActivityTab(tabIndex === 0 ? "past" : "upcoming");