Skip to content

Commit 85fec7a

Browse files
authored
Merge pull request #6262 from decentraland/fix/catalog-using-peer-testing
fix: Load items from builder-server using peer-testing
1 parent ae68fec commit 85fec7a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

browser-interface/packages/config/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ export const BYPASS_CONTENT_ALLOWLIST = qs.has('BYPASS_CONTENT_ALLOWLIST')
107107
? qs.get('BYPASS_CONTENT_ALLOWLIST') === 'true'
108108
: PIN_CATALYST || globalThis.location.hostname !== 'play.decentraland.org'
109109

110+
export const PEER_TESTING_CATALYST = 'https://peer-testing.decentraland.org'
111+
110112
const META_CONFIG_URL = ensureSingleString(qs.get('META_CONFIG_URL'))
111113

112114
export const CHANNEL_TO_JOIN_CONFIG_URL = ensureSingleString(qs.get('CHANNEL'))

browser-interface/packages/shared/catalogs/sagas.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import {
99
ETHEREUM_NETWORK,
1010
BUILDER_SERVER_URL,
1111
rootURLPreviewMode,
12-
WITH_FIXED_ITEMS
12+
WITH_FIXED_ITEMS,
13+
PEER_TESTING_CATALYST
1314
} from 'config'
1415

1516
import { authorizeBuilderHeaders } from 'lib/decentraland/authentication/authorizeBuilderHeaders'
@@ -122,8 +123,12 @@ function* fetchItemsFromCatalyst(
122123
const identity: ExplorerIdentity = yield select(getCurrentIdentity)
123124
const client: CatalystClient = new CatalystClient({ catalystUrl })
124125
const network: ETHEREUM_NETWORK = yield select(getSelectedNetwork)
125-
const COLLECTIONS_OR_ITEMS_ALLOWED =
126-
PREVIEW || ((DEBUG || getTLD() !== 'org') && network !== ETHEREUM_NETWORK.MAINNET)
126+
const isPreviewMode = PREVIEW
127+
const isDebugOrNonOrgTLD = DEBUG || getTLD() !== 'org'
128+
const isNonMainnetOrTestingPeer =
129+
network !== ETHEREUM_NETWORK.MAINNET ||
130+
(network === ETHEREUM_NETWORK.MAINNET && catalystUrl === PEER_TESTING_CATALYST)
131+
const COLLECTIONS_OR_ITEMS_ALLOWED = isPreviewMode || (isDebugOrNonOrgTLD && isNonMainnetOrTestingPeer)
127132
const isRequestingEmotes = action.type === EMOTES_REQUEST
128133
const catalystFetchFn = isRequestingEmotes ? client.fetchEmotes : client.fetchWearables
129134
const result: PartialItem[] = []
@@ -264,7 +269,7 @@ function fetchOwnedEmotes(ethAddress: string, client: CatalystClient) {
264269

265270
export function urnWithoutToken(urn: string): string {
266271
const value = urn.split(':')
267-
if (value.length === 7 && !urn.includes("collections-thirdparty")) {
272+
if (value.length === 7 && !urn.includes('collections-thirdparty')) {
268273
return value.slice(0, 6).join(':')
269274
}
270275
return urn

0 commit comments

Comments
 (0)