• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mizchi / next-editor / 1409

pending completion
1409

Pull #349

circleci

web-flow
chore(deps): update babel monorepo
Pull Request #349: chore(deps): update babel monorepo

95 of 450 branches covered (21.11%)

Branch coverage included in aggregate %.

967 of 2058 relevant lines covered (46.99%)

1.93 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/ui/components/utils/OnlineDetector.tsx
1
import React from "react"
×
2
import { connector } from "../../actionCreators"
×
3

4
class OnlineDetectorImpl extends React.PureComponent<{
5
  networkOnline: boolean
6
  changeNetworkStatus: (payload: { online: boolean }) => void
7
}> {
8
  _onOnline: any = null
×
9
  _onOffline: any = null
×
10

11
  componentDidMount() {
12
    const { networkOnline, changeNetworkStatus } = this.props
×
13

14
    if (networkOnline !== navigator.onLine) {
15
      changeNetworkStatus({ online: navigator.onLine })
×
16
    }
17
    this._onOffline = () => changeNetworkStatus({ online: false })
×
18
    this._onOnline = () => changeNetworkStatus({ online: true })
×
19

20
    window.addEventListener("offline", this._onOffline)
×
21
    window.addEventListener("online", this._onOnline)
×
22
  }
23

24
  componentWillUnmount() {
25
    window.removeEventListener("offline", this._onOffline)
×
26
    window.removeEventListener("online", this._onOnline)
×
27
  }
28

29
  render() {
30
    return <></>
×
31
  }
32
}
33

34
export const OnlineDetector = connector(
×
35
  s => ({ networkOnline: s.app.networkOnline }),
×
36
  actions => ({
×
37
    changeNetworkStatus: actions.app.changeNetworkStatus
38
  })
39
)(function OnlineDetectorImpl_(props) {
40
  return (
×
41
    <OnlineDetectorImpl
42
      networkOnline={props.networkOnline}
43
      changeNetworkStatus={props.changeNetworkStatus}
44
    />
45
  )
46
})
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc