UI: fix long telemetry log loading bug
This commit is contained in:
parent
97327f08a2
commit
063286e899
|
@ -4,6 +4,7 @@ import LoadingIcon from '../ui-components/LoadingIcon';
|
||||||
|
|
||||||
|
|
||||||
const authComponent = new AuthComponent({});
|
const authComponent = new AuthComponent({});
|
||||||
|
const telemetryUpdatePeriod = 5000; // UI will fetch telemetries every N milliseconds.
|
||||||
|
|
||||||
const TelemetryLog = (props: { onStatusChange: Function }) => {
|
const TelemetryLog = (props: { onStatusChange: Function }) => {
|
||||||
|
|
||||||
|
@ -19,7 +20,8 @@ const TelemetryLog = (props: { onStatusChange: Function }) => {
|
||||||
const telemetryConsole = useRef(null);
|
const telemetryConsole = useRef(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const interval = setInterval(updateTelemetryFromServer, 5000);
|
updateTelemetryFromServer();
|
||||||
|
const interval = setInterval(updateTelemetryFromServer, telemetryUpdatePeriod);
|
||||||
return function cleanup() {
|
return function cleanup() {
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue