Browse Source

fix(contacts): fix some pending/closing contacts bugs

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
970dfdd98e
  1. 1
      app/components/Contacts/ClosingContact.js
  2. 2
      app/components/Contacts/ContactsForm.js
  3. 1
      app/components/Contacts/PendingContact.js
  4. 2
      app/reducers/channels.js
  5. 11
      app/routes/contacts/components/Contacts.js

1
app/components/Contacts/ClosingContact.js

@ -1,3 +1,4 @@
import { shell } from 'electron'
import React from 'react'
import PropTypes from 'prop-types'
import { FaCircle } from 'react-icons/lib/fa'

2
app/components/Contacts/ContactsForm.js

@ -89,6 +89,8 @@ class ContactsForm extends React.Component {
const [pubkey, host] = manualFormInput && manualFormInput.split('@')
openChannel({ pubkey, host, local_amt: contactsform.contactCapacity })
this.setState({ manualFormInput: '' })
}
return (

1
app/components/Contacts/PendingContact.js

@ -1,3 +1,4 @@
import { shell } from 'electron'
import React from 'react'
import PropTypes from 'prop-types'
import { FaCircle } from 'react-icons/lib/fa'

2
app/reducers/channels.js

@ -350,7 +350,7 @@ const allChannels = createSelector(
const filteredPendingForcedClosedChannels = pendingForcedClosedChannels.filter(channel => channel.channel.remote_node_pub.includes(searchQuery) || channel.channel.channel_point.includes(searchQuery)) // eslint-disable-line
return [...filteredActiveChannels, ...filteredNonActiveChannels, ...filteredPendingOpenChannels, ...filteredPendingClosedChannels, ...filteredPendingForcedClosedChannels]
return [...filteredActiveChannels, ...filteredPendingOpenChannels, ...filteredPendingClosedChannels, ...filteredPendingForcedClosedChannels, ...filteredNonActiveChannels]
}
)

11
app/routes/contacts/components/Contacts.js

@ -1,4 +1,3 @@
import { shell } from 'electron'
import React, { Component } from 'react'
import PropTypes from 'prop-types'
@ -151,14 +150,14 @@ class Contacts extends Component {
<ul className={`${styles.friends} ${filterPulldown && styles.fade}`}>
{
currentChannels.length > 0 && currentChannels.map((channel, index) => {
if (channel.active) {
return <OnlineContact channel={channel} key={index} />
} else if (!channel.active) {
return <OfflineContact channel={channel} key={index} />
} else if (Object.prototype.hasOwnProperty.call(channel, 'blocks_till_open')) {
if (Object.prototype.hasOwnProperty.call(channel, 'blocks_till_open')) {
return <PendingContact channel={channel} key={index} />
} else if (Object.prototype.hasOwnProperty.call(channel, 'closing_txid')) {
return <ClosingContact channel={channel} key={index} />
} else if (channel.active) {
return <OnlineContact channel={channel} key={index} />
} else if (!channel.active) {
return <OfflineContact channel={channel} key={index} />
}
})
}

Loading…
Cancel
Save