Skip to content

Commit

Permalink
Merge pull request #6262 from decentraland/fix/catalog-using-peer-tes…
Browse files Browse the repository at this point in the history
…ting

fix: Load items from builder-server using peer-testing
  • Loading branch information
cyaiox authored Jan 24, 2025
1 parent ae68fec commit 85fec7a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions browser-interface/packages/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ export const BYPASS_CONTENT_ALLOWLIST = qs.has('BYPASS_CONTENT_ALLOWLIST')
? qs.get('BYPASS_CONTENT_ALLOWLIST') === 'true'
: PIN_CATALYST || globalThis.location.hostname !== 'play.decentraland.org'

export const PEER_TESTING_CATALYST = 'https://peer-testing.decentraland.org'

const META_CONFIG_URL = ensureSingleString(qs.get('META_CONFIG_URL'))

export const CHANNEL_TO_JOIN_CONFIG_URL = ensureSingleString(qs.get('CHANNEL'))
Expand Down
13 changes: 9 additions & 4 deletions browser-interface/packages/shared/catalogs/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
ETHEREUM_NETWORK,
BUILDER_SERVER_URL,
rootURLPreviewMode,
WITH_FIXED_ITEMS
WITH_FIXED_ITEMS,
PEER_TESTING_CATALYST
} from 'config'

import { authorizeBuilderHeaders } from 'lib/decentraland/authentication/authorizeBuilderHeaders'
Expand Down Expand Up @@ -122,8 +123,12 @@ function* fetchItemsFromCatalyst(
const identity: ExplorerIdentity = yield select(getCurrentIdentity)
const client: CatalystClient = new CatalystClient({ catalystUrl })
const network: ETHEREUM_NETWORK = yield select(getSelectedNetwork)
const COLLECTIONS_OR_ITEMS_ALLOWED =
PREVIEW || ((DEBUG || getTLD() !== 'org') && network !== ETHEREUM_NETWORK.MAINNET)
const isPreviewMode = PREVIEW
const isDebugOrNonOrgTLD = DEBUG || getTLD() !== 'org'
const isNonMainnetOrTestingPeer =
network !== ETHEREUM_NETWORK.MAINNET ||
(network === ETHEREUM_NETWORK.MAINNET && catalystUrl === PEER_TESTING_CATALYST)
const COLLECTIONS_OR_ITEMS_ALLOWED = isPreviewMode || (isDebugOrNonOrgTLD && isNonMainnetOrTestingPeer)
const isRequestingEmotes = action.type === EMOTES_REQUEST
const catalystFetchFn = isRequestingEmotes ? client.fetchEmotes : client.fetchWearables
const result: PartialItem[] = []
Expand Down Expand Up @@ -264,7 +269,7 @@ function fetchOwnedEmotes(ethAddress: string, client: CatalystClient) {

export function urnWithoutToken(urn: string): string {
const value = urn.split(':')
if (value.length === 7 && !urn.includes("collections-thirdparty")) {
if (value.length === 7 && !urn.includes('collections-thirdparty')) {
return value.slice(0, 6).join(':')
}
return urn
Expand Down

0 comments on commit 85fec7a

Please sign in to comment.