fixed flow issues

pull/59/head
Szymon Lesisz 6 years ago
parent 0e08826ed0
commit 99da867617

@ -7,8 +7,9 @@
.*/node_modules/redux/.* .*/node_modules/redux/.*
.*/node_modules/react-router/.* .*/node_modules/react-router/.*
.*/node_modules/react-router-redux/.* .*/node_modules/react-router-redux/.*
.*/node_modules/oboe/test/.*
.*/_old/.* .*/_old/.*
.*/src/solidity/.* .*/public/solidity/.*
[libs] [libs]
./src/flowtype/npm/redux_v3.x.x.js ./src/flowtype/npm/redux_v3.x.x.js
@ -41,4 +42,5 @@ module.name_mapper='^views' -> '<PROJECT_ROOT>/src/views'
module.name_mapper='^data' -> '<PROJECT_ROOT>/src/data' module.name_mapper='^data' -> '<PROJECT_ROOT>/src/data'
module.name_mapper='^services' -> '<PROJECT_ROOT>/src/services' module.name_mapper='^services' -> '<PROJECT_ROOT>/src/services'
module.name_mapper='^support' -> '<PROJECT_ROOT>/src/support' module.name_mapper='^support' -> '<PROJECT_ROOT>/src/support'
module.name_mapper='^public' -> '<PROJECT_ROOT>/public'
module.system=haste module.system=haste

@ -24,14 +24,14 @@ export const onPinSubmit = (value: string): Action => {
}; };
}; };
export const onPassphraseSubmit = (/* passphrase: string */): AsyncAction => async (dispatch: Dispatch): Promise<void> => { export const onPassphraseSubmit = (passphrase: string): AsyncAction => async (dispatch: Dispatch): Promise<void> => {
// const resp = await TrezorConnect.uiResponse({ const resp = await TrezorConnect.uiResponse({
// type: UI.RECEIVE_PASSPHRASE, type: UI.RECEIVE_PASSPHRASE,
// payload: { payload: {
// value: passphrase, value: passphrase,
// save: true, save: true,
// }, },
// }); });
dispatch({ dispatch({
type: MODAL.CLOSE, type: MODAL.CLOSE,

@ -12,7 +12,7 @@ import icons from 'config/icons';
import colors from 'config/colors'; import colors from 'config/colors';
import Link from 'components/Link'; import Link from 'components/Link';
import { Props } from './index'; import type { Props } from 'components/modals/index';
type State = { type State = {
defaultName: string; defaultName: string;

@ -4,7 +4,7 @@ import { render } from 'react-dom';
import baseStyles from 'support/BaseStyles'; import baseStyles from 'support/BaseStyles';
import { onBeforeUnload } from 'actions/WalletActions'; import { onBeforeUnload } from 'actions/WalletActions';
import App from 'views/index'; import App from 'views/index';
import store from 'store'; import store from './store';
const root: ?HTMLElement = document.getElementById('root'); const root: ?HTMLElement = document.getElementById('root');
if (root) { if (root) {

@ -4,7 +4,7 @@
// import root from 'window-or-global'; // import root from 'window-or-global';
// import Promise from 'es6-promise'; // import Promise from 'es6-promise';
export async function resolveAfter<T>(msec: number, value: any = null): Promise<T> { export async function resolveAfter(msec: number, value?: any): Promise<any> {
await new Promise((resolve) => { await new Promise((resolve) => {
//root.setTimeout(resolve, msec, value); //root.setTimeout(resolve, msec, value);
window.setTimeout(resolve, msec, value); window.setTimeout(resolve, msec, value);

@ -113,6 +113,9 @@ const AccountMenu = (props: Props): ?React$Element<string> => {
const { config } = props.localStorage; const { config } = props.localStorage;
const selectedCoin = config.coins.find(c => c.network === location.state.network); const selectedCoin = config.coins.find(c => c.network === location.state.network);
if (!selected || !selectedCoin) return;
const fiatRate = props.fiat.find(f => f.network === selectedCoin.network); const fiatRate = props.fiat.find(f => f.network === selectedCoin.network);
const deviceAccounts: Accounts = findDeviceAccounts(accounts, selected, location.state.network); const deviceAccounts: Accounts = findDeviceAccounts(accounts, selected, location.state.network);

@ -20,7 +20,7 @@ import TopNavigationAccount from './components/TopNavigationAccount';
import TopNavigationDeviceSettings from './components/TopNavigationDeviceSettings'; import TopNavigationDeviceSettings from './components/TopNavigationDeviceSettings';
type WalletContainerProps = { type WalletContainerProps = {
// wallet: $ElementType<State, 'wallet'>, wallet: $ElementType<State, 'wallet'>,
children?: React.Node children?: React.Node
} }

@ -237,7 +237,7 @@ class AccountSend extends Component<Props, State> {
} }
getTokensSelectData(tokens: Array<Token>, accountNetwork: any) { getTokensSelectData(tokens: Array<Token>, accountNetwork: any) {
const tokensSelectData = tokens.map(t => ({ value: t.symbol, label: t.symbol })); const tokensSelectData: Array<{ value: string, label: string }> = tokens.map(t => ({ value: t.symbol, label: t.symbol }));
tokensSelectData.unshift({ value: accountNetwork.symbol, label: accountNetwork.symbol }); tokensSelectData.unshift({ value: accountNetwork.symbol, label: accountNetwork.symbol });
return tokensSelectData; return tokensSelectData;

@ -97,7 +97,7 @@ class AccountBalance extends Component<Props, State> {
let fiat = ''; let fiat = '';
if (fiatRate) { if (fiatRate) {
accountBalance = new BigNumber(this.props.balance); accountBalance = new BigNumber(this.props.balance);
fiatRateValue = new BigNumber(fiatRate.value); fiatRateValue = new BigNumber(fiatRate.value).toFixed(2);
fiat = accountBalance.times(fiatRateValue).toFixed(2); fiat = accountBalance.times(fiatRateValue).toFixed(2);
} }
@ -127,7 +127,7 @@ class AccountBalance extends Component<Props, State> {
{fiatRate && ( {fiatRate && (
<BalanceWrapper> <BalanceWrapper>
<Label>Rate</Label> <Label>Rate</Label>
<FiatValue>${fiatRateValue.toFixed(2)}</FiatValue> <FiatValue>${fiatRateValue}</FiatValue>
<CoinBalace>1.00 {selectedCoin.symbol}</CoinBalace> <CoinBalace>1.00 {selectedCoin.symbol}</CoinBalace>
</BalanceWrapper> </BalanceWrapper>
)} )}

Loading…
Cancel
Save