Browse Source

feature(channel-error): display global error for channel error

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
85ea73819c
  1. 2
      app/components/Channels/ChannelForm.js
  2. 2
      app/lnd/push/openchannel.js
  3. 15
      app/reducers/channels.js
  4. 5
      webpack.config.renderer.dev.js

2
app/components/Channels/ChannelForm.js

@ -14,7 +14,7 @@ const ChannelForm = ({ form, setForm, ticker, peers, openChannel, currentTicker
const pushamt = ticker.currency === 'usd' ? btc.btcToSatoshis(usd.usdToBtc(push_amt, currentTicker.price_usd)) : btc.btcToSatoshis(push_amt)
openChannel({ pubkey: node_key, localamt, pushamt })
setForm({ isOpen: false })
// setForm({ isOpen: false })
}
const customStyles = {

2
app/lnd/push/openchannel.js

@ -5,7 +5,7 @@ export default function pushopenchannel(lnd, event, payload) {
call.on('data', data => event.sender.send('pushchannelupdated', { data }))
call.on('end', () => event.sender.send('pushchannelend'))
call.on('error', error => event.sender.send('pushchannelerror', { error }))
call.on('error', error => event.sender.send('pushchannelerror', { error: error.toString() }))
call.on('status', status => event.sender.send('pushchannelstatus', { status }))
resolve(null, payload)

15
app/reducers/channels.js

@ -1,5 +1,6 @@
import { createSelector } from 'reselect'
import { ipcRenderer } from 'electron'
import { setError } from './error'
// ------------------------------------
// Constants
// ------------------------------------
@ -89,21 +90,25 @@ export const channelSuccessful = () => (dispatch) => {
// Receive IPC event for updated channel
export const pushchannelupdated = () => (dispatch) => {
console.log('channelUpdatedData: ', channelUpdatedData)
dispatch(fetchChannels())
}
// Receive IPC event for channel end
export const pushchannelend = () => (dispatch) => {
export const pushchannelend = (event, channelEndData) => (dispatch) => {
console.log('channelEndData: ', channelEndData)
dispatch(fetchChannels())
}
// Receive IPC event for channel error
export const pushchannelerror = () => (dispatch) => {
dispatch(fetchChannels())
export const pushchannelerror = (event, { error }) => (dispatch) => {
dispatch(openingFailure())
dispatch(setError(error))
}
// Receive IPC event for channel status
export const pushchannelstatus = () => (dispatch) => {
export const pushchannelstatus = (event, channelStatusData) => (dispatch) => {
console.log('channel Status data: ', channelStatusData)
dispatch(fetchChannels())
}
@ -168,6 +173,8 @@ const ACTION_HANDLERS = {
),
[OPENING_CHANNEL]: state => ({ ...state, openingChannel: true }),
[OPENING_FAILURE]: state => ({ ...state, openingChannel: false }),
[CLOSING_CHANNEL]: state => ({ ...state, closingChannel: true })
}

5
webpack.config.renderer.dev.js

@ -25,6 +25,7 @@ const publicPath = `http://localhost:${port}/dist`;
const dll = path.resolve(process.cwd(), 'dll');
const manifest = path.resolve(dll, 'renderer.json');
console.log('one')
/**
* Warn if the DLL is not built
*/
@ -35,6 +36,8 @@ if (!(fs.existsSync(dll) && fs.existsSync(manifest))) {
execSync('npm run build-dll');
}
console.log('two')
export default merge.smart(baseConfig, {
devtool: 'inline-source-map',
@ -279,3 +282,5 @@ export default merge.smart(baseConfig, {
}
}
});
console.log('three')

Loading…
Cancel
Save