mirror of
https://github.com/trezor/trezor-wallet
synced 2025-06-26 09:52:36 +00:00
fix all flow
This commit is contained in:
parent
36848591c0
commit
ec5786ad03
@ -360,11 +360,11 @@ export const getImportedAccounts = (): ?Array<Account> => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const handleCoinVisibility = (
|
export const handleCoinVisibility = (
|
||||||
coinShortcut: String,
|
coinShortcut: string,
|
||||||
shouldBeVisible: boolean
|
shouldBeVisible: boolean
|
||||||
): ThunkAction => (dispatch: Dispatch): void => {
|
): ThunkAction => (dispatch: Dispatch): void => {
|
||||||
const configuration: Array<String> = getHiddenCoins();
|
const configuration: Array<string> = getHiddenCoins();
|
||||||
let newConfig: Array<String> = configuration;
|
let newConfig: Array<string> = configuration;
|
||||||
const isAlreadyHidden = configuration.find(coin => coin === coinShortcut);
|
const isAlreadyHidden = configuration.find(coin => coin === coinShortcut);
|
||||||
|
|
||||||
if (isAlreadyHidden && shouldBeVisible) {
|
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);
|
const coinsConfig: ?string = storageUtils.get(TYPE, KEY_HIDDEN_COINS);
|
||||||
if (coinsConfig) {
|
if (coinsConfig) {
|
||||||
return JSON.parse(coinsConfig);
|
return JSON.parse(coinsConfig);
|
||||||
|
@ -27,7 +27,7 @@ export type WalletAction =
|
|||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: typeof WALLET.SET_HIDDEN_COINS,
|
type: typeof WALLET.SET_HIDDEN_COINS,
|
||||||
hiddenCoins: Array<String>,
|
hiddenCoins: Array<string>,
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: typeof WALLET.TOGGLE_DEVICE_DROPDOWN,
|
type: typeof WALLET.TOGGLE_DEVICE_DROPDOWN,
|
||||||
|
@ -24,7 +24,7 @@ type State = {
|
|||||||
firstLocationChange: boolean,
|
firstLocationChange: boolean,
|
||||||
disconnectRequest: ?TrezorDevice,
|
disconnectRequest: ?TrezorDevice,
|
||||||
selectedDevice: ?TrezorDevice,
|
selectedDevice: ?TrezorDevice,
|
||||||
hiddenCoins: ?Array<String>,
|
hiddenCoins: Array<string>,
|
||||||
};
|
};
|
||||||
|
|
||||||
const initialState: State = {
|
const initialState: State = {
|
||||||
|
@ -4,10 +4,18 @@ import React from 'react';
|
|||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import { FONT_SIZE } from 'config/variables';
|
import { FONT_SIZE } from 'config/variables';
|
||||||
import coins from 'constants/coins';
|
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 { colors, Switch, CoinLogo, Tooltip, Icon, icons as ICONS } from 'trezor-ui-components';
|
||||||
import l10nMessages from '../../index.messages';
|
import l10nMessages from '../../index.messages';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
networks: Array<Network>,
|
||||||
|
hiddenCoins: Array<string>,
|
||||||
|
handleCoinVisibility: typeof LocalStorageActions.handleCoinVisibility,
|
||||||
|
};
|
||||||
|
|
||||||
const Wrapper = styled.div`
|
const Wrapper = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
Loading…
Reference in New Issue
Block a user