浏览代码

remove ts ignore

Aakansha Doshi 4 年之前
父节点
当前提交
5644063fc7
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/components/App.tsx

+ 7 - 2
src/components/App.tsx

@@ -884,16 +884,21 @@ class App extends React.Component<ExcalidrawProps, AppState> {
       prevState.showStats !== this.state.showStats ||
       prevProps.isCollaborating !== this.props.isCollaborating
     ) {
+      const navigator: Navigator & {
+        connection?: {
+          addEventListener: Function;
+          removeEventListener: Function;
+        };
+      } = window.navigator;
+
       if (this.state.showStats && this.props.isCollaborating) {
         this.calculateNetStats();
 
-        // @ts-ignore
         navigator?.connection?.addEventListener(
           "change",
           this.calculateNetStats,
         );
       } else {
-        // @ts-ignore
         navigator?.connection?.removeEventListener(
           "change",
           this.calculateNetStats,