Fixed callback error on loading of URi

This commit is contained in:
Pax1601 2024-06-27 20:02:53 +02:00
parent 13e75e9dd1
commit 1e48df85a7
2 changed files with 3 additions and 2 deletions

View File

@ -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 ],

View File

@ -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));
}