From 1e48df85a727951e52822054f7f9105176fe1f6e Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Thu, 27 Jun 2024 20:02:53 +0200 Subject: [PATCH] Fixed callback error on loading of URi --- frontend/react/src/map/map.ts | 3 ++- frontend/react/src/server/servermanager.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/react/src/map/map.ts b/frontend/react/src/map/map.ts index 1fd8e940..ed761437 100644 --- a/frontend/react/src/map/map.ts +++ b/frontend/react/src/map/map.ts @@ -641,7 +641,8 @@ export class Map extends L.Map { } else if (this.#state === SPAWN_UNIT) { if (this.#spawnRequestTable !== null) { - const location = this.getMouseCoordinates(); + const location = e.latlng; + this.#spawnRequestTable.unit.location = e.latlng; getApp().getUnitsManager().spawnUnits( this.#spawnRequestTable.category, [ this.#spawnRequestTable.unit ], diff --git a/frontend/react/src/server/servermanager.ts b/frontend/react/src/server/servermanager.ts index e0a853e5..d7eeb259 100644 --- a/frontend/react/src/server/servermanager.ts +++ b/frontend/react/src/server/servermanager.ts @@ -115,7 +115,7 @@ export class ServerManager { xmlHttp.setRequestHeader("Authorization", "Basic " + btoa(`${this.#username}:${this.#password}`)); xmlHttp.onload = (res: any) => { var res = JSON.parse(xmlHttp.responseText); - callback(res); + callback(res.commandHash); }; xmlHttp.send(JSON.stringify(request)); }