diff --git a/src/components/App.tsx b/src/components/App.tsx index f74fb54fe..0f4f7f056 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -884,16 +884,21 @@ class App extends React.Component { 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,