Skip to content

Commit

Permalink
refactor: disable live when is all
Browse files Browse the repository at this point in the history
  • Loading branch information
Siumauricio committed Jan 3, 2025
1 parent 47fb2cc commit bb37a51
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,14 @@ export const ShowMonitoring = ({
useEffect(() => {
fetchMetrics();

const interval = setInterval(() => {
fetchMetrics();
}, REFRESH_INTERVAL);
// Solo crear el intervalo si no es "all"
if (dataPoints !== "all") {
const interval = setInterval(() => {
fetchMetrics();
}, REFRESH_INTERVAL);

return () => clearInterval(interval);
return () => clearInterval(interval);
}
}, [dataPoints]);

if (isLoading) {
Expand Down

0 comments on commit bb37a51

Please sign in to comment.