diff --git a/webapp/src/components/AssetProvider/AssetProvider.container.ts b/webapp/src/components/AssetProvider/AssetProvider.container.ts index d757ef3ce0..d2a532430c 100644 --- a/webapp/src/components/AssetProvider/AssetProvider.container.ts +++ b/webapp/src/components/AssetProvider/AssetProvider.container.ts @@ -21,12 +21,7 @@ import { getOpenRentalId } from '../../modules/rental/utils' import { FetchOneOptions } from '../../modules/vendor' import { ContractName } from '../../modules/vendor/decentraland' import { convertToOutputString } from '../../utils/output' -import { - getItemContractAddressFromUrl, - getItemTokenIdFromUrl, - getNFTContractAddressFromUrl, - getNFTTokenIdFromUrl -} from '../../utils/routing' +import { getItemContractAddressFromUrl, getItemIdFromUrl, getNFTContractAddressFromUrl, getNFTTokenIdFromUrl } from '../../utils/routing' import AssetProvider from './AssetProvider' import { MapDispatch, MapDispatchProps, MapStateProps, OwnProps } from './AssetProvider.types' @@ -51,7 +46,7 @@ const mapState = (state: RootState, ownProps: OwnProps): MapStateProps => { case AssetType.ITEM: { const items = getItems(state) contractAddress = contractAddress || getItemContractAddressFromUrl() - tokenId = tokenId || getItemTokenIdFromUrl() + tokenId = tokenId || getItemIdFromUrl() asset = getItem(contractAddress, tokenId, items) isLoading = isFetchingItem(state, contractAddress!, tokenId!) error = getItemsError(state) diff --git a/webapp/src/utils/routing.ts b/webapp/src/utils/routing.ts index 7b2ab4ce49..2ed4a823e3 100644 --- a/webapp/src/utils/routing.ts +++ b/webapp/src/utils/routing.ts @@ -13,9 +13,9 @@ export const getCollectionDetailUrlParams = () => export const getCollectionContractAddressFromUrl = () => getCollectionDetailUrlParams()?.contractAddress.toLowerCase() || null export const getItemUrlParams = () => - matchAppRoute<{ contractAddress: string; tokenId: string }>(window.location.pathname, locations.item())?.params + matchAppRoute<{ contractAddress: string; itemId: string }>(window.location.pathname, locations.item())?.params export const getItemContractAddressFromUrl = () => getItemUrlParams()?.contractAddress.toLowerCase() || null -export const getItemTokenIdFromUrl = () => getItemUrlParams()?.tokenId || null +export const getItemIdFromUrl = () => getItemUrlParams()?.itemId || null export const getNFTUrlParams = () => matchAppRoute<{ contractAddress: string; tokenId: string }>(window.location.pathname, locations.nft())?.params