mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
clear timer before starting new one
This commit is contained in:
parent
3eacd6f07b
commit
bc9c8f7ee2
1 changed files with 3 additions and 0 deletions
|
@ -1034,6 +1034,9 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
const speed = await getNetworkSpeed();
|
||||
const networkSpeed = speed === "-1" ? "Error!" : speed;
|
||||
this.setState({ networkSpeed });
|
||||
if (this.netStatsIntervalId) {
|
||||
clearTimeout(this.netStatsIntervalId);
|
||||
}
|
||||
this.netStatsIntervalId = setTimeout(
|
||||
this.calculateNetStats,
|
||||
NETWORK_SPEED_TIMEOUT_MS,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue