|
@ -22,7 +22,7 @@ export const RECEIVE_BLOCK_HEIGHT = 'RECEIVE_BLOCK_HEIGHT' |
|
|
export const lndSyncing = () => dispatch => dispatch({ type: START_SYNCING }) |
|
|
export const lndSyncing = () => dispatch => dispatch({ type: START_SYNCING }) |
|
|
|
|
|
|
|
|
// Receive IPC event for LND stoping sync
|
|
|
// Receive IPC event for LND stoping sync
|
|
|
export const lndSynced = () => dispatch => { |
|
|
export const lndSynced = () => (dispatch) => { |
|
|
// Fetch data now that we know LND is synced
|
|
|
// Fetch data now that we know LND is synced
|
|
|
dispatch(fetchTicker()) |
|
|
dispatch(fetchTicker()) |
|
|
dispatch(fetchBalance()) |
|
|
dispatch(fetchBalance()) |
|
@ -60,11 +60,11 @@ export const fetchBlockHeight = () => async (dispatch) => { |
|
|
const ACTION_HANDLERS = { |
|
|
const ACTION_HANDLERS = { |
|
|
[START_SYNCING]: state => ({ ...state, syncing: true }), |
|
|
[START_SYNCING]: state => ({ ...state, syncing: true }), |
|
|
[STOP_SYNCING]: state => ({ ...state, syncing: false }), |
|
|
[STOP_SYNCING]: state => ({ ...state, syncing: false }), |
|
|
|
|
|
|
|
|
[RECEIVE_LINE]: (state, { lndBlockHeight }) => ({ ...state, lndBlockHeight }), |
|
|
[RECEIVE_LINE]: (state, { lndBlockHeight }) => ({ ...state, lndBlockHeight }), |
|
|
|
|
|
|
|
|
[GET_BLOCK_HEIGHT]: state => ({ ...state, fetchingBlockHeight: true }), |
|
|
[GET_BLOCK_HEIGHT]: state => ({ ...state, fetchingBlockHeight: true }), |
|
|
[RECEIVE_BLOCK_HEIGHT]: (state, { blockHeight }) => ({ ...state, blockHeight, fetchingBlockHeight: false }), |
|
|
[RECEIVE_BLOCK_HEIGHT]: (state, { blockHeight }) => ({ ...state, blockHeight, fetchingBlockHeight: false }) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// ------------------------------------
|
|
|
// ------------------------------------
|
|
|