diff --git a/renderer/reducers/activity/reducer.js b/renderer/reducers/activity/reducer.js index 1f89b0a44cf..28637c10e42 100644 --- a/renderer/reducers/activity/reducer.js +++ b/renderer/reducers/activity/reducer.js @@ -195,7 +195,8 @@ function createActivityPaginator() { const { transactions } = await grpc.services.Lightning.getTransactions() return { items: transactions, offset: 0 } } - const getTimestamp = item => item.timeStamp || item.settleDate || item.creationDate + const getTimestamp = item => + parseInt(item.timeStamp, 10) || parseInt(item.settleDate, 10) || parseInt(item.creationDate, 10) const itemSorter = (a, b) => getTimestamp(b) - getTimestamp(a) return combinePaginators(itemSorter, fetchInvoices, fetchPayments, fetchTransactions) } @@ -222,7 +223,6 @@ export const loadNextPage = () => async (dispatch, getState) => { const thisPaginator = getPaginator() if (activitySelectors.hasNextPage(getState())) { const { items, hasNextPage } = await thisPaginator(config.activity.pageSize) - const getItemType = item => { if (item.destAddresses) { return 'transactions' diff --git a/renderer/reducers/invoice.js b/renderer/reducers/invoice.js index 654fb568f0d..85e243e6145 100644 --- a/renderer/reducers/invoice.js +++ b/renderer/reducers/invoice.js @@ -1,6 +1,5 @@ import { createSelector } from 'reselect' import uniqBy from 'lodash/uniqBy' -import config from 'config' import createReducer from '@zap/utils/createReducer' import { showSystemNotification } from '@zap/utils/notifications' import { convert } from '@zap/utils/btc' @@ -120,21 +119,6 @@ export function sendInvoice() { } } -/** - * fetchInvoices - Fetch details of all invoices. - * - * @returns {object} Action - */ -export const fetchInvoices = ({ - maxInvoices = config.activity.pageSize, -} = {}) => async dispatch => { - dispatch(getInvoices()) - const { invoices } = await grpc.services.Lightning.listInvoices({ - numMaxInvoices: maxInvoices, - }) - dispatch(receiveInvoices(invoices)) -} - /** * receiveInvoices - Receive details of all invoice. * diff --git a/renderer/reducers/payment/reducer.js b/renderer/reducers/payment/reducer.js index abe7e87659a..f282501d8ca 100644 --- a/renderer/reducers/payment/reducer.js +++ b/renderer/reducers/payment/reducer.js @@ -53,16 +53,6 @@ const initialState = { // Actions // ------------------------------------ -/** - * getPayments - Initiate fetching all payments. - * - * @returns {object} Action - */ -export function getPayments() { - return { - type: GET_PAYMENTS, - } -} /** * receivePayments - Fetch payments success callback. * @@ -112,17 +102,6 @@ export const sendPayment = data => dispatch => { }) } -/** - * fetchPayments - Fetch details of all lightning payments. - * - * @returns {Function} Thunk - */ -export const fetchPayments = () => async dispatch => { - dispatch(getPayments()) - const { payments } = await grpc.services.Lightning.listPayments() - dispatch(receivePayments(payments)) -} - /** * updatePayment - Updates specified payment request. *