diff --git a/src/game/GameApp.ts b/src/game/GameApp.ts index 5409b48..bebed4c 100644 --- a/src/game/GameApp.ts +++ b/src/game/GameApp.ts @@ -102,6 +102,7 @@ export class GameApp { private readonly fleetWindowTitleEl: HTMLHeadingElement; private readonly debugWindowEl: HTMLDivElement; private readonly sessionActionsEl: HTMLDivElement; + private lastShipWindowMarkup = ""; private universe: UniverseDefinition; constructor(container: HTMLElement) { @@ -2123,7 +2124,11 @@ export class GameApp { this.ordersEl.dataset.mode = this.selectedStation ? "station" : this.selection.length > 0 ? "ships" : "none"; this.fleetWindowEl.dataset.open = this.windowState["fleet-command"] ? "true" : "false"; this.fleetWindowTitleEl.textContent = "Ships"; - this.fleetWindowBodyEl.innerHTML = getShipWindowMarkup(this.ships, this.selection); + const shipWindowMarkup = getShipWindowMarkup(this.ships, this.selection); + if (shipWindowMarkup !== this.lastShipWindowMarkup) { + this.fleetWindowBodyEl.innerHTML = shipWindowMarkup; + this.lastShipWindowMarkup = shipWindowMarkup; + } this.debugWindowEl.dataset.open = this.windowState.debug ? "true" : "false"; }