From bf5d6dac182a40c999db1c1c226cb4831a4dc86d Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Mon, 4 Sep 2023 11:00:28 +0200 Subject: [PATCH] Minor bugfix --- client/src/contextmenus/mapcontextmenu.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/client/src/contextmenus/mapcontextmenu.ts b/client/src/contextmenus/mapcontextmenu.ts index 41e02388..90780d12 100644 --- a/client/src/contextmenus/mapcontextmenu.ts +++ b/client/src/contextmenus/mapcontextmenu.ts @@ -98,18 +98,17 @@ export class MapContextMenu extends ContextMenu { this.#navyUnitSpawnMenu.setCountries(); /* Only a Game Master can choose the coalition of a new unit */ - if (getMissionHandler().getCommandModeOptions().commandMode !== GAME_MASTER) { + if (getMissionHandler().getCommandModeOptions().commandMode !== GAME_MASTER) this.#coalitionSwitch.hide() - } else { - this.getContainer()?.querySelectorAll('[data-coalition]').forEach((element: any) => { element.setAttribute("data-coalition", getActiveCoalition()) }); - if (getActiveCoalition() == "blue") - this.#coalitionSwitch.setValue(false); - else if (getActiveCoalition() == "red") - this.#coalitionSwitch.setValue(true); - else - this.#coalitionSwitch.setValue(undefined); - } + this.getContainer()?.querySelectorAll('[data-coalition]').forEach((element: any) => { element.setAttribute("data-coalition", getActiveCoalition()) }); + if (getActiveCoalition() == "blue") + this.#coalitionSwitch.setValue(false); + else if (getActiveCoalition() == "red") + this.#coalitionSwitch.setValue(true); + else + this.#coalitionSwitch.setValue(undefined); + /* Hide the coalition area button. It will be visible if a coalition area is set */ this.getContainer()?.querySelector("#coalition-area-button")?.classList.toggle("hide", true); }