fix typing after merge

This commit is contained in:
fernandomg 2020-07-13 16:25:38 -03:00
parent c0fe3fb904
commit caaf7c8812
10 changed files with 24 additions and 24 deletions

View File

@ -10,6 +10,7 @@ import Col from 'src/components/layout/Col'
import Paragraph from 'src/components/layout/Paragraph'
import { safesCountSelector } from 'src/routes/safe/store/selectors'
import { border, md, screenSm, sm, xs } from 'src/theme/variables'
import { AppReduxState } from '../../../../store'
export const TOGGLE_SIDEBAR_BTN_TESTID = 'TOGGLE_SIDEBAR_BTN'
@ -59,8 +60,4 @@ const SafeListHeader = ({ safesCount }) => {
)
}
export default connect(
// $FlowFixMe
(state) => ({ safesCount: safesCountSelector(state) }),
null,
)(SafeListHeader)
export default connect((state: AppReduxState) => ({ safesCount: safesCountSelector(state) }), null)(SafeListHeader)

View File

@ -18,6 +18,7 @@ import { WELCOME_ADDRESS } from 'src/routes/routes'
import setDefaultSafe from 'src/routes/safe/store/actions/setDefaultSafe'
import { defaultSafeSelector, safeParamAddressFromStateSelector } from 'src/routes/safe/store/selectors'
import { AppReduxState } from '../../store'
const { useEffect, useMemo, useState } = React
@ -123,8 +124,7 @@ const Sidebar = ({ children, currentSafe, defaultSafe, safes, setDefaultSafeActi
}
export default connect(
// $FlowFixMe
(state) => ({
(state: AppReduxState) => ({
safes: sortedSafeListSelector(state),
defaultSafe: defaultSafeSelector(state),
currentSafe: safeParamAddressFromStateSelector(state),

View File

@ -19,6 +19,7 @@ import Img from 'src/components/layout/Img'
import { getNetwork } from 'src/config'
import { ETHEREUM_NETWORK } from 'src/logic/wallets/getWeb3'
import { networkSelector } from 'src/logic/wallets/store/selectors'
import { AppReduxState } from '../../../store'
const notificationStyles = {
success: {
@ -75,7 +76,7 @@ const PageFrame = ({ children, classes, currentNetwork }) => {
export default withStyles(notificationStyles)(
connect(
(state) => ({
(state: AppReduxState) => ({
currentNetwork: networkSelector(state),
}),
null,

View File

@ -26,7 +26,7 @@ export const activeNftAssetsListSelector = createSelector(
export const safeActiveSelectorMap = createSelector(
activeNftAssetsListSelector,
(activeAssets): RNFTAssets => {
(activeAssets): NFTAssets => {
const assetsMap = {}
activeAssets.forEach((asset) => {

View File

@ -2,10 +2,10 @@ import { Map } from 'immutable'
import { createSelector } from 'reselect'
import { TOKEN_REDUCER_ID } from 'src/logic/tokens/store/reducer/tokens'
import { Token } from '../model/token'
import { GnosisState } from 'src/store'
import { Token } from 'src/logic/tokens/store/model/token'
import { AppReduxState } from 'src/store'
export const tokensSelector = (state: GnosisState): Map<string, Token> => state[TOKEN_REDUCER_ID]
export const tokensSelector = (state: AppReduxState): Map<string, Token> => state[TOKEN_REDUCER_ID]
export const tokenListSelector = createSelector(tokensSelector, (tokens) => tokens.toList())

View File

@ -2,12 +2,13 @@
import { PROVIDER_REDUCER_ID } from 'src/logic/wallets/store/reducer/provider'
import { userAccountSelector } from '../selectors'
import { ProviderFactory } from './builder/index.builder'
import { AppReduxState } from 'src/store'
const providerReducerTests = () => {
describe('Provider Name Selector[userAccountSelector]', () => {
it('should return empty when no provider is loaded', () => {
// GIVEN
const reduxStore = { [PROVIDER_REDUCER_ID]: ProviderFactory.noProvider }
const reduxStore = { [PROVIDER_REDUCER_ID]: ProviderFactory.noProvider } as AppReduxState
// WHEN
const providerName = userAccountSelector(reduxStore)
@ -18,7 +19,7 @@ const providerReducerTests = () => {
it('should return empty when Metamask is loaded but not available', () => {
// GIVEN
const reduxStore = { [PROVIDER_REDUCER_ID]: ProviderFactory.metamaskLoaded }
const reduxStore = { [PROVIDER_REDUCER_ID]: ProviderFactory.metamaskLoaded } as AppReduxState
// WHEN
const providerName = userAccountSelector(reduxStore)
@ -29,7 +30,7 @@ const providerReducerTests = () => {
it('should return account when Metamask is loaded and available', () => {
// GIVEN
const reduxStore = { [PROVIDER_REDUCER_ID]: ProviderFactory.metamaskAvailable }
const reduxStore = { [PROVIDER_REDUCER_ID]: ProviderFactory.metamaskAvailable } as AppReduxState
// WHEN
const providerName = userAccountSelector(reduxStore)

View File

@ -2,12 +2,13 @@
import { PROVIDER_REDUCER_ID } from 'src/logic/wallets/store/reducer/provider'
import { providerNameSelector } from '../selectors'
import { ProviderFactory } from './builder/index.builder'
import { AppReduxState } from 'src/store'
const providerReducerTests = () => {
describe('Provider Name Selector[providerNameSelector]', () => {
it('should return undefined when no provider is loaded', () => {
// GIVEN
const reduxStore = { [PROVIDER_REDUCER_ID]: ProviderFactory.noProvider }
const reduxStore = { [PROVIDER_REDUCER_ID]: ProviderFactory.noProvider } as AppReduxState
// WHEN
const providerName = providerNameSelector(reduxStore)
@ -18,7 +19,7 @@ const providerReducerTests = () => {
it('should return metamask when Metamask is loaded but not available', () => {
// GIVEN
const reduxStore = { [PROVIDER_REDUCER_ID]: ProviderFactory.metamaskLoaded }
const reduxStore = { [PROVIDER_REDUCER_ID]: ProviderFactory.metamaskLoaded } as AppReduxState
// WHEN
const providerName = providerNameSelector(reduxStore)
@ -29,7 +30,7 @@ const providerReducerTests = () => {
it('should return METAMASK when Metamask is loaded and available', () => {
// GIVEN
const reduxStore = { [PROVIDER_REDUCER_ID]: ProviderFactory.metamaskAvailable }
const reduxStore = { [PROVIDER_REDUCER_ID]: ProviderFactory.metamaskAvailable } as AppReduxState
// WHEN
const providerName = providerNameSelector(reduxStore)

View File

@ -25,7 +25,7 @@ export const useFetchTokens = (safeAddress: string): void => {
if (COLLECTIBLES_LOCATION_REGEX.test(location.pathname)) {
batch(() => {
dispatch(fetchCollectibles(safeAddress)).then(() => {
dispatch<any>(fetchCollectibles(safeAddress)).then(() => {
dispatch(activateAssetsByBalance(safeAddress))
})
})

View File

@ -37,7 +37,7 @@ import fetchTransactions from './transactions/fetchTransactions'
import { safeTransactionsSelector } from 'src/routes/safe/store/selectors'
import { TransactionStatus, TxArgs } from 'src/routes/safe/store/models/types/transaction'
import { Dispatch } from 'redux'
import { GnosisState } from 'src/store'
import { AppReduxState } from 'src/store'
export const removeTxFromStore = (tx, safeAddress, dispatch, state) => {
if (tx.isCancellationTx) {
@ -106,7 +106,7 @@ const createTransaction = ({
operation = CALL,
navigateToTransactionsTab = true,
origin = null,
}: CreateTransaction) => async (dispatch: Dispatch, getState: () => GnosisState): Promise<void> => {
}: CreateTransaction) => async (dispatch: Dispatch, getState: () => AppReduxState): Promise<void> => {
const state = getState()
if (navigateToTransactionsTab) {

View File

@ -97,7 +97,7 @@ export default handleActions(
}),
)
},
[REMOVE_SAFE_OWNER]: (state: SafeStoreState, action) => {
[REMOVE_SAFE_OWNER]: (state: SafeReducerMap, action) => {
const { ownerAddress, safeAddress } = action.payload
return state.updateIn([SAFE_REDUCER_ID, safeAddress], (prevSafe) =>