Skip to content

Commit

Permalink
Merge f0c46e0 into 2b9c54a
Browse files Browse the repository at this point in the history
  • Loading branch information
meelrossi committed Jun 18, 2024
2 parents 2b9c54a + f0c46e0 commit b0e6bbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { ContractName } from '../../modules/vendor/decentraland'
import { convertToOutputString } from '../../utils/output'
import {
getItemContractAddressFromUrl,
getItemTokenIdFromUrl,
getItemIdFromUrl,
getNFTContractAddressFromUrl,
getNFTTokenIdFromUrl
} from '../../utils/routing'
Expand Down Expand Up @@ -51,7 +51,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)
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/utils/routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b0e6bbd

Please sign in to comment.