Browse Source

fix(lints): Call d3 modifiers on the selection itself

Rather than iterating over the selection.
renovate/lint-staged-8.x
Ben Woosley 7 years ago
parent
commit
3829046857
No known key found for this signature in database GPG Key ID: 6EE5F3785F78B345
  1. 15
      app/components/Network/CanvasNetworkGraph.js
  2. 2
      app/lnd/lib/lightning.js

15
app/components/Network/CanvasNetworkGraph.js

@ -107,10 +107,7 @@ class CanvasNetworkGraph extends Component {
const { selectedPeerPubkeys } = this.props
// remove active class
d3.selectAll('.active-peer')
.each(function () {
d3.select(this).classed('active-peer', false)
})
d3.selectAll('.active-peer').classed('active-peer', false)
// add active class to all selected peers
selectedPeerPubkeys.forEach((pubkey) => {
@ -122,10 +119,7 @@ class CanvasNetworkGraph extends Component {
const { selectedChannelIds } = this.props
// remove active class
d3.selectAll('.active-channel')
.each(function () {
d3.select(this).classed('active-channel', false)
})
d3.selectAll('.active-channel').classed('active-channel', false)
// add active class to all selected peers
selectedChannelIds.forEach((chanid) => {
@ -210,10 +204,7 @@ class CanvasNetworkGraph extends Component {
const { currentRouteChanIds } = this.props
// remove all route animations before rendering new ones
d3.selectAll('.animated-route-circle')
.each(function () {
d3.select(this).remove()
})
d3.selectAll('.animated-route-circle').remove()
currentRouteChanIds.forEach((chanId) => {
const link = document.getElementById(`link-${chanId}`)

2
app/lnd/lib/lightning.js

@ -7,6 +7,6 @@ module.exports = (rpcpath, host) => {
const lndCert = fs.readFileSync(config.cert)
const credentials = grpc.credentials.createSsl(lndCert)
const rpc = grpc.load(path.join(__dirname, 'rpc.proto'))
return new rpc.lnrpc.Lightning(host, credentials)
}

Loading…
Cancel
Save