UI: fix long telemetry log loading bug

This commit is contained in:
VakarisZ 2021-10-28 16:22:24 +03:00
parent 97327f08a2
commit 063286e899
1 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import LoadingIcon from '../ui-components/LoadingIcon';
const authComponent = new AuthComponent({});
const telemetryUpdatePeriod = 5000; // UI will fetch telemetries every N milliseconds.
const TelemetryLog = (props: { onStatusChange: Function }) => {
@ -19,7 +20,8 @@ const TelemetryLog = (props: { onStatusChange: Function }) => {
const telemetryConsole = useRef(null);
useEffect(() => {
const interval = setInterval(updateTelemetryFromServer, 5000);
updateTelemetryFromServer();
const interval = setInterval(updateTelemetryFromServer, telemetryUpdatePeriod);
return function cleanup() {
clearInterval(interval);
};