mirror of
https://github.com/ansible/awx.git
synced 2026-05-25 09:37:45 -02:30
Replace loadHost with an IIFE
This commit is contained in:
@@ -39,9 +39,11 @@ function Host({ inventory, i18n, setBreadcrumb }) {
|
||||
? '/hosts'
|
||||
: `/inventories/inventory/${inventoriesMatch.params.id}/hosts`;
|
||||
|
||||
const loadHost = async () => {
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
setContentError(null);
|
||||
setHasContentLoading(true);
|
||||
|
||||
try {
|
||||
const hostId = hostsMatch
|
||||
? hostsMatch.params.id
|
||||
@@ -59,10 +61,7 @@ function Host({ inventory, i18n, setBreadcrumb }) {
|
||||
} finally {
|
||||
setHasContentLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
loadHost();
|
||||
})();
|
||||
}, [location]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
const tabsArray = [
|
||||
|
||||
Reference in New Issue
Block a user