chore: general code cleanup
This commit is contained in:
parent
bc12b04601
commit
21d716c1b0
|
@ -1,8 +1,8 @@
|
|||
// @flow
|
||||
|
||||
import { connect } from 'react-redux';
|
||||
import { closeErrorModal } from '../redux/modules/app';
|
||||
|
||||
import { closeErrorModal } from '../redux/modules/app';
|
||||
import { LayoutComponent } from '../components/layout';
|
||||
|
||||
import type { Dispatch } from '../types/redux';
|
||||
|
|
|
@ -6,16 +6,19 @@ import flow from 'lodash.flow';
|
|||
import groupBy from 'lodash.groupby';
|
||||
import dateFns from 'date-fns';
|
||||
import { BigNumber } from 'bignumber.js';
|
||||
|
||||
import { DashboardView } from '../views/dashboard';
|
||||
|
||||
import rpc from '../../services/api';
|
||||
import { listShieldedTransactions } from '../../services/shielded-transactions';
|
||||
import store from '../../config/electron-store';
|
||||
import { listShieldedTransactions } from '../../services/shielded-transactions';
|
||||
import { sortByDescend } from '../utils/sort-by-descend';
|
||||
|
||||
import {
|
||||
loadWalletSummary,
|
||||
loadWalletSummarySuccess,
|
||||
loadWalletSummaryError,
|
||||
} from '../redux/modules/wallet';
|
||||
import { sortByDescend } from '../utils/sort-by-descend';
|
||||
|
||||
import type { AppState } from '../types/app-state';
|
||||
import type { Dispatch } from '../types/redux';
|
||||
|
|
|
@ -42,13 +42,13 @@ const mapDispatchToProps = (dispatch: Dispatch): MapDispatchToProps => ({
|
|||
|
||||
if (zAddressesErr || tAddressesErr) return dispatch(loadAddressesError({ error: 'Something went wrong!' }));
|
||||
|
||||
const latestzAddress = zAddresses[0]
|
||||
const latestZAddress = zAddresses[0]
|
||||
? {
|
||||
address: zAddresses[0],
|
||||
balance: await rpc.z_getbalance(zAddresses[0]),
|
||||
}
|
||||
: null;
|
||||
const latesttAddress = transparentAddresses[0]
|
||||
const latestTAddress = transparentAddresses[0]
|
||||
? {
|
||||
address: transparentAddresses[0],
|
||||
balance: await rpc.z_getbalance(transparentAddresses[0]),
|
||||
|
@ -68,7 +68,7 @@ const mapDispatchToProps = (dispatch: Dispatch): MapDispatchToProps => ({
|
|||
|
||||
dispatch(
|
||||
loadAddressesSuccess({
|
||||
addresses: [latestzAddress, latesttAddress, ...allAddresses].filter(Boolean),
|
||||
addresses: [latestZAddress, latestTAddress, ...allAddresses].filter(Boolean),
|
||||
}),
|
||||
);
|
||||
},
|
||||
|
|
|
@ -163,14 +163,14 @@ const mapDispatchToProps = (dispatch: Dispatch): MapDispatchToProps => ({
|
|||
|
||||
if (zAddressesErr || tAddressesErr) return dispatch(loadAddressesError({ error: 'Something went wrong!' }));
|
||||
|
||||
const latestzAddress = zAddresses[0]
|
||||
const latestZAddress = zAddresses[0]
|
||||
? {
|
||||
address: zAddresses[0],
|
||||
balance: await rpc.z_getbalance(zAddresses[0]),
|
||||
}
|
||||
: null;
|
||||
|
||||
const latesttAddress = transparentAddresses[0]
|
||||
const latestTAddress = transparentAddresses[0]
|
||||
? {
|
||||
address: transparentAddresses[0],
|
||||
balance: await rpc.z_getbalance(transparentAddresses[0]),
|
||||
|
@ -190,7 +190,7 @@ const mapDispatchToProps = (dispatch: Dispatch): MapDispatchToProps => ({
|
|||
|
||||
return dispatch(
|
||||
loadAddressesSuccess({
|
||||
addresses: [latesttAddress, latestzAddress, ...allAddresses].filter(Boolean),
|
||||
addresses: [latestTAddress, latestZAddress, ...allAddresses].filter(Boolean),
|
||||
}),
|
||||
);
|
||||
},
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// @flow
|
||||
|
||||
import eres from 'eres';
|
||||
import { connect } from 'react-redux';
|
||||
import electron from 'electron'; // eslint-disable-line
|
||||
|
|
Loading…
Reference in New Issue