diff --git a/app/components/Channels/ChannelForm.js b/app/components/Channels/ChannelForm.js index 816cf48b..5334af6f 100644 --- a/app/components/Channels/ChannelForm.js +++ b/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 = { diff --git a/app/lnd/push/openchannel.js b/app/lnd/push/openchannel.js index a2df85b2..7bf8958a 100644 --- a/app/lnd/push/openchannel.js +++ b/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) diff --git a/app/reducers/channels.js b/app/reducers/channels.js index b0a9f20c..863c4156 100644 --- a/app/reducers/channels.js +++ b/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 }) } diff --git a/webpack.config.renderer.dev.js b/webpack.config.renderer.dev.js index 02625bed..b76b554c 100644 --- a/webpack.config.renderer.dev.js +++ b/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')