Fixing "Query string parameters prevent WA from loading"

Due to a regression, query string parameters added to the URL (like:

http://play.workadventure.localhost/_/global/maps.workadventure.localhost/starter/map.json?utm_source=sendinblue&utm_campaign=WA+-+2021+Christmap+map+launch&utm_medium=email#foo

) were causing a crash in WA.

Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com>
This commit is contained in:
Gregoire Parant 2021-11-30 17:29:53 +01:00
parent 7b52c13fae
commit b098b5f37d

View file

@ -132,13 +132,14 @@ class ConnectionManager {
const roomUrl = data.roomUrl;
const query = urlParams.toString();
this._currentRoom = await Room.createRoom(
new URL(
window.location.protocol +
"//" +
window.location.host +
roomUrl +
urlParams.toString() + //use urlParams because the token param must be deleted
(query ? "?" + query : "") + //use urlParams because the token param must be deleted
window.location.hash
)
);