Skip to content

Commit

Permalink
Fixed prettier and refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
doracretu3pillar committed Nov 14, 2024
1 parent 911537f commit 0103eaf
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions public/app/percona/inventory/Tabs/Services.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const Services = () => {
const dispatch = useAppDispatch();
const { services: fetchedServices } = useSelector(getServices);
const styles = useStyles2(getStyles);
const [isLoading, setIsLoading] = useState(false);
const [isLoading, setIsLoading] = useState(true);
const flattenServices = useMemo(
() =>
fetchedServices.map((value) => {
Expand Down Expand Up @@ -73,13 +73,12 @@ export const Services = () => {
}, []);

useEffect(() => {
if (!fetchedServices) {
setIsLoading(true);
}
loadData().then(() => {
triggerTimeout(loadData, DATA_INTERVAL);
setIsLoading(false);
});
loadData()
.then(() => {
triggerTimeout(loadData, DATA_INTERVAL);
setIsLoading(false);
})
.catch(() => setIsLoading(false));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [loadData]);

Expand Down

0 comments on commit 0103eaf

Please sign in to comment.