From f73e9a4b04273b9d14251ecdaf67d8615d78c49b Mon Sep 17 00:00:00 2001 From: Braian Mellor Date: Fri, 19 Apr 2024 12:55:19 -0300 Subject: [PATCH] fix: change content server url for zone env (#454) --- src/config/dev.json | 6 +++--- src/entities/Place/utils.ts | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/config/dev.json b/src/config/dev.json index df9ee250..23ad86ab 100644 --- a/src/config/dev.json +++ b/src/config/dev.json @@ -1,9 +1,9 @@ { "GATSBY_CHAIN_ID": "1,137", - "GATSBY_DECENTRALAND_URL": "https://play.decentraland.org", - "GATSBY_LAND_URL": "https://api.decentraland.org", + "GATSBY_DECENTRALAND_URL": "https://play.decentraland.zone", + "GATSBY_LAND_URL": "https://api.decentraland.zone", "GATSBY_PLACES_URL": "https://places.decentraland.zone/api", - "GATSBY_PROFILE_URL": "https://peer.decentraland.org", + "GATSBY_PROFILE_URL": "https://peer.decentraland.zone", "GATSBY_INTERCOM_APP_ID": "z0h94kay", "GATSBY_SENTRY_SRC": "https://js.sentry-cdn.com/bb04b48d542c5a48ad9f41ea2429a500.min.js", "GATSBY_SEGMENT_KEY": "e7wld8fcDnqyiQjjDFJ6DCnV1S89G3tS", diff --git a/src/entities/Place/utils.ts b/src/entities/Place/utils.ts index b4b6409e..f4fc300f 100644 --- a/src/entities/Place/utils.ts +++ b/src/entities/Place/utils.ts @@ -16,6 +16,11 @@ const DECENTRALAND_URL = process.env.DECENTRALAND_URL || "https://play.decentraland.org" +const CONTENT_SERVER_URL = + process.env.GATSBY_PROFILE_URL || + process.env.PROFILE_URL || + "https://peer.decentraland.org" + export function placeUrl(place: PlaceAttributes) { const target = new URL(env("PLACES_URL", "https://places.decentraland.org")) target.searchParams.set("position", toCanonicalPosition(place.base_position)!) @@ -83,7 +88,7 @@ export function getThumbnailFromDeployment(deployment: ContentEntityScene) { if (!content || unwantedThumbnailHash.includes(content.hash)) { thumbnail = null } else { - thumbnail = `https://peer.decentraland.org/content/contents/${content.hash}` + thumbnail = `${CONTENT_SERVER_URL}/content/contents/${content.hash}` } } @@ -106,7 +111,7 @@ export function getThumbnailFromContentDeployment( (content) => content.file === thumbnail ) const contentServerUrl = ( - options.url || "https://peer.decentraland.org/content" + options.url || `${CONTENT_SERVER_URL}/content` ).replace(/\/+$/, "") if (!content || unwantedThumbnailHash.includes(content.hash)) {