diff --git a/browser-interface/packages/config/index.ts b/browser-interface/packages/config/index.ts index 527984da30..decc9d1d53 100644 --- a/browser-interface/packages/config/index.ts +++ b/browser-interface/packages/config/index.ts @@ -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')) diff --git a/browser-interface/packages/shared/catalogs/sagas.ts b/browser-interface/packages/shared/catalogs/sagas.ts index 0e21e830b4..32e59835b6 100644 --- a/browser-interface/packages/shared/catalogs/sagas.ts +++ b/browser-interface/packages/shared/catalogs/sagas.ts @@ -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' @@ -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[] = [] @@ -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