|
9 | 9 | ETHEREUM_NETWORK, |
10 | 10 | BUILDER_SERVER_URL, |
11 | 11 | rootURLPreviewMode, |
12 | | - WITH_FIXED_ITEMS |
| 12 | + WITH_FIXED_ITEMS, |
| 13 | + PEER_TESTING_CATALYST |
13 | 14 | } from 'config' |
14 | 15 |
|
15 | 16 | import { authorizeBuilderHeaders } from 'lib/decentraland/authentication/authorizeBuilderHeaders' |
@@ -122,8 +123,12 @@ function* fetchItemsFromCatalyst( |
122 | 123 | const identity: ExplorerIdentity = yield select(getCurrentIdentity) |
123 | 124 | const client: CatalystClient = new CatalystClient({ catalystUrl }) |
124 | 125 | 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) |
127 | 132 | const isRequestingEmotes = action.type === EMOTES_REQUEST |
128 | 133 | const catalystFetchFn = isRequestingEmotes ? client.fetchEmotes : client.fetchWearables |
129 | 134 | const result: PartialItem[] = [] |
@@ -264,7 +269,7 @@ function fetchOwnedEmotes(ethAddress: string, client: CatalystClient) { |
264 | 269 |
|
265 | 270 | export function urnWithoutToken(urn: string): string { |
266 | 271 | const value = urn.split(':') |
267 | | - if (value.length === 7 && !urn.includes("collections-thirdparty")) { |
| 272 | + if (value.length === 7 && !urn.includes('collections-thirdparty')) { |
268 | 273 | return value.slice(0, 6).join(':') |
269 | 274 | } |
270 | 275 | return urn |
|
0 commit comments