diff --git a/src/client/Main.ts b/src/client/Main.ts index 9f68e8f71..ab88d9f4c 100644 --- a/src/client/Main.ts +++ b/src/client/Main.ts @@ -160,11 +160,14 @@ class Client { }); const TerritoryModal = document.querySelector( - "territory-patterns-input", + "territory-patterns-modal", ) as territoryPatternsModal; - const tpButton = document.getElementById("territory-patterns-input_"); + const tpButton = document.getElementById( + "territory-patterns-input-preview-button", + ); TerritoryModal instanceof territoryPatternsModal; - if (tpButton === null) throw new Error("Missing territory-patterns-input_"); + if (tpButton === null) + throw new Error("territory-patterns-input-preview-button"); tpButton.addEventListener("click", () => { TerritoryModal.open(); }); diff --git a/src/client/SinglePlayerModal.ts b/src/client/SinglePlayerModal.ts index bf90eb8ce..3726c60e8 100644 --- a/src/client/SinglePlayerModal.ts +++ b/src/client/SinglePlayerModal.ts @@ -447,7 +447,7 @@ export class SinglePlayerModal extends LitElement { flagInput.getCurrentFlag() === "xx" ? "" : flagInput.getCurrentFlag(), - pattern: localStorage.getItem("territoryPattern"), + pattern: localStorage.getItem("territoryPattern") ?? null, }, ], config: { diff --git a/src/client/TerritoryPatternsModal.ts b/src/client/TerritoryPatternsModal.ts index c6881d3da..9fbb0160f 100644 --- a/src/client/TerritoryPatternsModal.ts +++ b/src/client/TerritoryPatternsModal.ts @@ -4,14 +4,15 @@ import territory_patterns from "../../resources/territory_patterns.json"; import "./components/Difficulties"; import "./components/Maps"; -@customElement("territory-patterns-input") +@customElement("territory-patterns-modal") export class territoryPatternsModal extends LitElement { @query("o-modal") private modalEl!: HTMLElement & { open: () => void; close: () => void; }; - @query("#territory-patterns-input_") private previewButton!: HTMLElement; + @query("#territory-patterns-input-preview-button") + private previewButton!: HTMLElement; @state() private selectedPattern = localStorage.getItem("territoryPattern") || ""; diff --git a/src/client/index.html b/src/client/index.html index afbdd8357..cbfed1228 100644 --- a/src/client/index.html +++ b/src/client/index.html @@ -262,13 +262,13 @@
- + - +