Skip to content

Commit

Permalink
fix: change content server url for zone env (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
braianj authored Apr 19, 2024
1 parent d5455ac commit f73e9a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/config/dev.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
9 changes: 7 additions & 2 deletions src/entities/Place/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)!)
Expand Down Expand Up @@ -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}`
}
}

Expand All @@ -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)) {
Expand Down

0 comments on commit f73e9a4

Please sign in to comment.