1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-13 20:08:56 +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);
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,
toggled: boolean,
};
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 RouterActions from 'actions/RouterActions';
import * as ModalActions from 'actions/ModalActions';
import { toggleDeviceDropdown } from 'actions/WalletActions';
import * as WalletActions from 'actions/WalletActions';
import type { State } from 'flowtype';
export type StateProps = {
@ -19,7 +19,9 @@ export type StateProps = {
};
export type DispatchProps = {
toggleDeviceDropdown: typeof toggleDeviceDropdown,
toggleDeviceDropdown: typeof WalletActions.toggleDeviceDropdown,
toggleSidebar: typeof WalletActions.toggleSidebar,
setHideBalance: typeof WalletActions.setHideBalance,
addAccount: typeof DiscoveryActions.addAccount,
acquireDevice: typeof TrezorConnectActions.acquire,
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) {
this.setState({
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);
if (prevProps.isHidden !== this.props.isHidden) {
this.setState({

View File

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