mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix
This commit is contained in:
parent
8157c84d11
commit
b5151bda5a
4 changed files with 14 additions and 9 deletions
|
@ -1,4 +1,3 @@
|
|||
// @ts-nocheck
|
||||
import { Point, simplify } from "points-on-curve";
|
||||
import React from "react";
|
||||
import { RoughCanvas } from "roughjs/bin/canvas";
|
||||
|
@ -854,9 +853,15 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
) {
|
||||
if (this.state.showStats && this.props.isCollaborating) {
|
||||
this.calculateNetStats();
|
||||
navigator.connection.addEventListener("change", this.calculateNetStats);
|
||||
|
||||
// @ts-ignore
|
||||
navigator?.connection?.addEventListener(
|
||||
"change",
|
||||
this.calculateNetStats,
|
||||
);
|
||||
} else {
|
||||
navigator.connection.removeEventListener(
|
||||
// @ts-ignore
|
||||
navigator?.connection?.removeEventListener(
|
||||
"change",
|
||||
this.calculateNetStats,
|
||||
);
|
||||
|
@ -990,7 +995,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
|
||||
private calculateNetStats = async () => {
|
||||
const speed = await getNetworkSpeed();
|
||||
const networkSpeed = speed === -1 ? "Error!" : speed;
|
||||
const networkSpeed = speed === "-1" ? "Error!" : speed;
|
||||
this.setState({ networkSpeed });
|
||||
};
|
||||
// Copy/paste
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue