fix
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -30,7 +30,7 @@ export const Stats = (props: {
|
||||
setAppState: React.Component<any, AppState>["setState"];
|
||||
elements: readonly NonDeletedExcalidrawElement[];
|
||||
onClose: () => void;
|
||||
isCollaborating: boolean;
|
||||
isCollaborating?: boolean;
|
||||
}) => {
|
||||
const isMobile = useIsMobile();
|
||||
const [storageSizes, setStorageSizes] = useState<StorageSizes>({
|
||||
|
||||
Reference in New Issue
Block a user