hotfix: remove ramda

This commit is contained in:
George Lima 2018-12-15 12:08:18 -03:00
parent 956782679b
commit 7abc3b20ad
3 changed files with 32 additions and 14 deletions

View File

@ -2,12 +2,17 @@
import { connect } from 'react-redux';
import eres from 'eres';
import * as R from 'ramda';
import flow from 'lodash.flow';
import groupBy from 'lodash.groupby';
import dateFns from 'date-fns';
import { DashboardView } from '../views/dashboard';
import rpc from '../../services/api';
import store from '../../config/electron-store';
import { loadWalletSummary, loadWalletSummarySuccess, loadWalletSummaryError } from '../redux/modules/wallet';
import {
loadWalletSummary,
loadWalletSummarySuccess,
loadWalletSummaryError,
} from '../redux/modules/wallet';
import type { AppState } from '../types/app-state';
import type { Dispatch } from '../types/redux';
@ -33,11 +38,18 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
const [addressesErr, addresses] = await eres(rpc.z_listaddresses());
// eslint-disable-next-line
if (addressesErr) return dispatch(loadWalletSummaryError({ error: addressesErr.message }));
const [transactionsErr, transactions = []] = await eres(rpc.listtransactions());
const [transactionsErr, transactions = []] = await eres(
rpc.listtransactions(),
);
if (transactionsErr) return dispatch(loadWalletSummaryError({ error: transactionsErr.message }));
if (transactionsErr) {
return dispatch(
loadWalletSummaryError({ error: transactionsErr.message }),
);
}
dispatch(
loadWalletSummarySuccess({
@ -45,15 +57,15 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({
total: walletSummary.total,
shielded: walletSummary.private,
addresses,
transactions: R.pipe(
R.map(transaction => ({
transactions: flow([
arr => arr.map(transaction => ({
type: transaction.category,
date: new Date(transaction.time * 1000).toISOString(),
address: transaction.address,
amount: Math.abs(transaction.amount),
})),
R.groupBy(obj => dateFns.format(obj.date, 'MMM DD, YYYY')),
)(transactions),
arr => groupBy(arr, obj => dateFns.format(obj.date, 'MMM DD, YYYY')),
])(transactions),
zecPrice: store.get('ZEC_DOLLAR_PRICE'),
}),
);

View File

@ -93,10 +93,11 @@
"eres": "^1.0.1",
"got": "^9.3.2",
"history": "^4.7.2",
"lodash.flow": "^3.5.0",
"lodash.groupby": "^4.6.0",
"p-queue": "^3.0.0",
"process-exists": "^3.1.0",
"qrcode.react": "^0.8.0",
"ramda": "^0.26.1",
"react": "^16.6.0",
"react-click-outside": "tj/react-click-outside",
"react-dom": "^16.6.0",

View File

@ -8871,11 +8871,21 @@ lodash.flattendepth@^4.7.0:
resolved "https://registry.yarnpkg.com/lodash.flattendepth/-/lodash.flattendepth-4.7.0.tgz#b4d2d14fc7d9c53deb96642eb616fff22a60932f"
integrity sha1-tNLRT8fZxT3rlmQuthb/8ipgky8=
lodash.flow@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/lodash.flow/-/lodash.flow-3.5.0.tgz#87bf40292b8cf83e4e8ce1a3ae4209e20071675a"
integrity sha1-h79AKSuM+D5OjOGjrkIJ4gBxZ1o=
lodash.get@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=
lodash.groupby@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash.groupby/-/lodash.groupby-4.6.0.tgz#0b08a1dcf68397c397855c3239783832df7403d1"
integrity sha1-Cwih3PaDl8OXhVwyOXg4Mt90A9E=
lodash.isarguments@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a"
@ -11394,11 +11404,6 @@ raf@^3.4.0:
dependencies:
performance-now "^2.1.0"
ramda@^0.26.1:
version "0.26.1"
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06"
integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ==
randomatic@^3.0.0:
version "3.1.1"
resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed"