Skip to content

Commit

Permalink
fix: third-party wearable rendering (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleortega authored Jun 3, 2024
1 parent 25c20be commit 4b93c3f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ import { computeZoom, getZoom } from './zoom'

const DEFAULT_PROFILE = 'default'
const QUANTITY_OF_PARTS_ON_SHORTENED_ITEMS_URN = 6
const THIRD_PARTY_URN_ID = "collections-thirdparty"

function getTokenIdAndAssetUrn(completeUrn: string): { assetUrn: string; tokenId: string | undefined } {
const lastIndex = completeUrn.lastIndexOf(':')

return lastIndex !== -1 && completeUrn.split(':').length > QUANTITY_OF_PARTS_ON_SHORTENED_ITEMS_URN
return lastIndex !== -1 && completeUrn.split(':').length > QUANTITY_OF_PARTS_ON_SHORTENED_ITEMS_URN && !completeUrn.includes(THIRD_PARTY_URN_ID)
? { assetUrn: completeUrn.substring(0, lastIndex), tokenId: completeUrn.substring(lastIndex + 1) }
: { assetUrn: completeUrn, tokenId: undefined }
}
Expand Down

0 comments on commit 4b93c3f

Please sign in to comment.