Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount () {
this.CONNECTED_IP = this.props.settingsStore.IP_ADDRESS
this.zeroconf = new Zeroconf()
this.zeroconf.scan('GPMDP')
// this.zeroconf.scan('GPMDP')
this.zeroconf.on('start', () => console.log('start.'))
this.zeroconf.on('found', () => console.log('found'))
this.zeroconf.on('resolved', (service) => {
if (service.host !== this.CONNECTED_IP) {
console.log('found service, adding to list', service)
this.setState({
devices: this.state.devices.concat([service])
})
// this.props.settingsStore.updateIPAddress(service.host)
}
})
this.zeroconf.on('remove', (serviceName) => {
console.log('removed', serviceName)
this.setState({