Refactor build workflow by removing unnecessary dependency installation step and add new SaT configuration file with scene and source definitions
Some checks failed
Lint and Build / build (pull_request) Failing after 2m57s
Some checks failed
Lint and Build / build (pull_request) Failing after 2m57s
This commit is contained in:
parent
3c58ccc5af
commit
450b6d6044
4 changed files with 1010 additions and 19 deletions
|
@ -173,23 +173,25 @@ export function useSmartPolling(
|
|||
}, [callback]);
|
||||
|
||||
React.useEffect(() => {
|
||||
// Clear any existing interval before setting up a new one
|
||||
if (intervalRef.current) {
|
||||
clearInterval(intervalRef.current);
|
||||
intervalRef.current = null;
|
||||
}
|
||||
|
||||
if (isVisible) {
|
||||
// Start polling when visible
|
||||
callbackRef.current();
|
||||
intervalRef.current = setInterval(() => {
|
||||
callbackRef.current();
|
||||
}, interval);
|
||||
} else {
|
||||
// Stop polling when not visible
|
||||
if (intervalRef.current) {
|
||||
clearInterval(intervalRef.current);
|
||||
}
|
||||
}
|
||||
|
||||
return () => {
|
||||
if (intervalRef.current) {
|
||||
clearInterval(intervalRef.current);
|
||||
intervalRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [interval, isVisible, dependencies]);
|
||||
}, [interval, isVisible, ...dependencies]);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue