1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-13 20:08:56 +00:00

fix all flow

This commit is contained in:
Vladimir Volek 2019-04-17 19:14:06 +02:00
parent 36848591c0
commit ec5786ad03
4 changed files with 14 additions and 6 deletions

View File

@ -360,11 +360,11 @@ export const getImportedAccounts = (): ?Array<Account> => {
};
export const handleCoinVisibility = (
coinShortcut: String,
coinShortcut: string,
shouldBeVisible: boolean
): ThunkAction => (dispatch: Dispatch): void => {
const configuration: Array<String> = getHiddenCoins();
let newConfig: Array<String> = configuration;
const configuration: Array<string> = getHiddenCoins();
let newConfig: Array<string> = configuration;
const isAlreadyHidden = configuration.find(coin => coin === coinShortcut);
if (isAlreadyHidden && shouldBeVisible) {
@ -380,7 +380,7 @@ export const handleCoinVisibility = (
});
};
export const getHiddenCoins = (): ?Array<String> => {
export const getHiddenCoins = (): Array<string> => {
const coinsConfig: ?string = storageUtils.get(TYPE, KEY_HIDDEN_COINS);
if (coinsConfig) {
return JSON.parse(coinsConfig);

View File

@ -27,7 +27,7 @@ export type WalletAction =
}
| {
type: typeof WALLET.SET_HIDDEN_COINS,
hiddenCoins: Array<String>,
hiddenCoins: Array<string>,
}
| {
type: typeof WALLET.TOGGLE_DEVICE_DROPDOWN,

View File

@ -24,7 +24,7 @@ type State = {
firstLocationChange: boolean,
disconnectRequest: ?TrezorDevice,
selectedDevice: ?TrezorDevice,
hiddenCoins: ?Array<String>,
hiddenCoins: Array<string>,
};
const initialState: State = {

View File

@ -4,10 +4,18 @@ import React from 'react';
import { FormattedMessage } from 'react-intl';
import { FONT_SIZE } from 'config/variables';
import coins from 'constants/coins';
import * as LocalStorageActions from 'actions/LocalStorageActions';
import type { Network } from 'flowtype';
import { colors, Switch, CoinLogo, Tooltip, Icon, icons as ICONS } from 'trezor-ui-components';
import l10nMessages from '../../index.messages';
type Props = {
networks: Array<Network>,
hiddenCoins: Array<string>,
handleCoinVisibility: typeof LocalStorageActions.handleCoinVisibility,
};
const Wrapper = styled.div`
display: flex;
flex-direction: column;