Fix show refetch loading spinner (#2324)

This commit is contained in:
gillespi314 2021-10-01 19:34:31 -05:00 committed by GitHub
parent 2df4389aa0
commit 29e79eb9bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -227,14 +227,14 @@ const HostDetailsPage = ({
const onRefetchHost = async () => {
if (host) {
// Once the user clicks to refetch, the refetch loading spinner should continue spinning
// unless there is an error or until the user refreshes the page.
setShowRefetchLoadingSpinner(true);
try {
await hostAPI.refetch(host);
} catch (error) {
console.log(error);
dispatch(renderFlash("error", `Host "${host.hostname}" refetch error`));
} finally {
setShowRefetchLoadingSpinner(false);
}
}
};