fix state type in collectibles selector

This commit is contained in:
fernandomg 2020-07-01 12:54:27 -03:00
parent fe987c0bbb
commit 1a095e561b
2 changed files with 7 additions and 5 deletions

View File

@ -1,12 +1,13 @@
import { List, Map } from 'immutable' import { List } from 'immutable'
import { createSelector } from 'reselect' import { createSelector } from 'reselect'
import { NFT_ASSETS_REDUCER_ID, NFT_TOKENS_REDUCER_ID } from 'src/logic/collectibles/store/reducer/collectibles' import { NFT_ASSETS_REDUCER_ID, NFT_TOKENS_REDUCER_ID } from 'src/logic/collectibles/store/reducer/collectibles'
import { safeActiveAssetsSelector } from 'src/routes/safe/store/selectors' import { safeActiveAssetsSelector } from 'src/routes/safe/store/selectors'
import { NFTAssets, NFTTokens, NFTAsset } from '../../sources/OpenSea' import { NFTAssets, NFTTokens, NFTAsset } from '../../sources/OpenSea'
import { GnosisState } from 'src/store'
export const nftAssetsSelector = (state: Map<string, unknown>): NFTAssets => state[NFT_ASSETS_REDUCER_ID] export const nftAssetsSelector = (state: GnosisState): NFTAssets => state[NFT_ASSETS_REDUCER_ID]
export const nftTokensSelector = (state: Map<string, unknown>): NFTTokens => state[NFT_TOKENS_REDUCER_ID] export const nftTokensSelector = (state: GnosisState): NFTTokens => state[NFT_TOKENS_REDUCER_ID]
export const nftAssetsListSelector = createSelector( export const nftAssetsListSelector = createSelector(
nftAssetsSelector, nftAssetsSelector,

View File

@ -33,6 +33,7 @@ import transactions, { TRANSACTIONS_REDUCER_ID } from 'src/routes/safe/store/red
import { ProviderRecord } from '../logic/wallets/store/model/provider' import { ProviderRecord } from '../logic/wallets/store/model/provider'
import { SafeRecordProps } from '../routes/safe/store/models/safe' import { SafeRecordProps } from '../routes/safe/store/models/safe'
import { Token } from '../logic/tokens/store/model/token' import { Token } from '../logic/tokens/store/model/token'
import { NFTAssets, NFTTokens } from '../logic/collectibles/sources/OpenSea'
export const history = createHashHistory({ hashType: 'slash' }) export const history = createHashHistory({ hashType: 'slash' })
@ -70,8 +71,8 @@ const reducers = combineReducers({
export type GnosisState = CombinedState<{ export type GnosisState = CombinedState<{
[PROVIDER_REDUCER_ID]?: ProviderRecord [PROVIDER_REDUCER_ID]?: ProviderRecord
[SAFE_REDUCER_ID]?: SafeRecordProps [SAFE_REDUCER_ID]?: SafeRecordProps
// [NFT_ASSETS_REDUCER_ID]: nftAssetReducer, [NFT_ASSETS_REDUCER_ID]?: NFTAssets
// [NFT_TOKENS_REDUCER_ID]: nftTokensReducer, [NFT_TOKENS_REDUCER_ID]?: NFTTokens
[TOKEN_REDUCER_ID]?: Map<string, Token> [TOKEN_REDUCER_ID]?: Map<string, Token>
// [TRANSACTIONS_REDUCER_ID]: transactions, // [TRANSACTIONS_REDUCER_ID]: transactions,
// [CANCELLATION_TRANSACTIONS_REDUCER_ID]: cancellationTransactions, // [CANCELLATION_TRANSACTIONS_REDUCER_ID]: cancellationTransactions,