Skip to content

Commit 6ae1f0f

Browse files
author
Melisa Anabella Rossi
authored
fix: explorer url redirection (#428)
1 parent 0fe33a7 commit 6ae1f0f

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/entities/Place/utils.test.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,18 @@ describe("Instance of URL", () => {
3535
describe("explorerUrl", () => {
3636
test("should return a string with an URL of a places with the realm", () => {
3737
const url = explorerUrl({ base_position: "-9,-9", world_name: null }, "dg")
38-
expect(url).toBe(
39-
"https://play.decentraland.org/play/?position=-9%2C-9&realm=dg"
40-
)
38+
expect(url).toBe("https://play.decentraland.org/?position=-9%2C-9&realm=dg")
4139
})
4240
test("should return a string with an URL of a places without the realm", () => {
4341
const url = explorerUrl({ base_position: "-9,-9", world_name: null })
44-
expect(url).toBe("https://play.decentraland.org/play/?position=-9%2C-9")
42+
expect(url).toBe("https://play.decentraland.org/?position=-9%2C-9")
4543
})
4644
test("should return a string with an URL of a world", () => {
4745
const url = explorerUrl({
4846
world_name: "paralax.dcl.eth",
4947
base_position: "-9,-9",
5048
})
51-
expect(url).toBe(
52-
"https://play.decentraland.org/play/?realm=paralax.dcl.eth"
53-
)
49+
expect(url).toBe("https://play.decentraland.org/?realm=paralax.dcl.eth")
5450
})
5551
})
5652

src/entities/Place/utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ function explorerPlaceUrl(
5151
realm?: string
5252
): string {
5353
const target = new URL("/", DECENTRALAND_URL)
54-
target.pathname = `/play/`
5554
if (place?.base_position) {
5655
target.searchParams.set("position", place.base_position)
5756
}
@@ -65,7 +64,6 @@ function explorerPlaceUrl(
6564
/** @private */
6665
function explorerWorldUrl(place: Pick<PlaceAttributes, "world_name">): string {
6766
const target = new URL("/", DECENTRALAND_URL)
68-
target.pathname = `/play/`
6967

7068
if (place) {
7169
target.searchParams.set("realm", place.world_name!)

0 commit comments

Comments
 (0)