1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-02-11 15:42:42 +00:00
This commit is contained in:
slowbackspace 2019-03-15 10:46:54 +01:00
parent 7c37d6745b
commit 7f2ce33d33
6 changed files with 18 additions and 7 deletions

View File

@ -286,7 +286,7 @@ const loadStorageData = (): ThunkAction => (dispatch: Dispatch): void => {
const hideBalance: ?boolean = storageUtils.get(TYPE, KEY_HIDE_BALANCE); const hideBalance: ?boolean = storageUtils.get(TYPE, KEY_HIDE_BALANCE);
if (hideBalance) { if (hideBalance) {
dispatch(WalletActions.setHideBalance(JSON.parse(hideBalance))); dispatch(WalletActions.setHideBalance(hideBalance));
} }
}; };

View File

@ -65,6 +65,7 @@ export type WalletAction =
} }
| { | {
type: typeof WALLET.SET_HIDE_BALANCE, type: typeof WALLET.SET_HIDE_BALANCE,
toggled: boolean,
}; };
export const init = (): ThunkAction => (dispatch: Dispatch): void => { export const init = (): ThunkAction => (dispatch: Dispatch): void => {

View File

@ -3,7 +3,7 @@ import * as TrezorConnectActions from 'actions/TrezorConnectActions';
import * as DiscoveryActions from 'actions/DiscoveryActions'; import * as DiscoveryActions from 'actions/DiscoveryActions';
import * as RouterActions from 'actions/RouterActions'; import * as RouterActions from 'actions/RouterActions';
import * as ModalActions from 'actions/ModalActions'; import * as ModalActions from 'actions/ModalActions';
import { toggleDeviceDropdown } from 'actions/WalletActions'; import * as WalletActions from 'actions/WalletActions';
import type { State } from 'flowtype'; import type { State } from 'flowtype';
export type StateProps = { export type StateProps = {
@ -19,7 +19,9 @@ export type StateProps = {
}; };
export type DispatchProps = { export type DispatchProps = {
toggleDeviceDropdown: typeof toggleDeviceDropdown, toggleDeviceDropdown: typeof WalletActions.toggleDeviceDropdown,
toggleSidebar: typeof WalletActions.toggleSidebar,
setHideBalance: typeof WalletActions.setHideBalance,
addAccount: typeof DiscoveryActions.addAccount, addAccount: typeof DiscoveryActions.addAccount,
acquireDevice: typeof TrezorConnectActions.acquire, acquireDevice: typeof TrezorConnectActions.acquire,
forgetDevice: typeof TrezorConnectActions.forget, forgetDevice: typeof TrezorConnectActions.forget,

View File

@ -111,7 +111,7 @@ class AccountBalance extends PureComponent<Props, State> {
}; };
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps: Props) {
if (prevProps.isHidden !== this.props.isHidden) { if (prevProps.isHidden !== this.props.isHidden) {
this.setState({ this.setState({
isHidden: this.props.isHidden, isHidden: this.props.isHidden,

View File

@ -109,7 +109,7 @@ class AccountBalance extends PureComponent<Props, State> {
}; };
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps: Props) {
console.log(this.props.isHidden); console.log(this.props.isHidden);
if (prevProps.isHidden !== this.props.isHidden) { if (prevProps.isHidden !== this.props.isHidden) {
this.setState({ this.setState({

View File

@ -4,8 +4,16 @@ import React from 'react';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import Content from 'views/Wallet/components/Content'; import Content from 'views/Wallet/components/Content';
import { Switch, Select, Link, Button, Tooltip, Icon, icons as ICONS } from 'trezor-ui-components'; import {
import colors from 'config/colors'; Switch,
Select,
Link,
Button,
Tooltip,
Icon,
icons as ICONS,
colors,
} from 'trezor-ui-components';
import { FIAT_CURRENCIES } from 'config/app'; import { FIAT_CURRENCIES } from 'config/app';
import { FONT_SIZE } from 'config/variables'; import { FONT_SIZE } from 'config/variables';
import l10nCommonMessages from 'views/common.messages'; import l10nCommonMessages from 'views/common.messages';