diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/deckBuildingUi.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/deckBuildingUi.js index a9b8c1460..264f557c0 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/deckBuildingUi.js +++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/deckBuildingUi.js @@ -335,12 +335,6 @@ var GempLotrDeckBuildingUI = Class.extend({ this.cardInfoDialog = new CardInfoDialog(window.innerWidth, window.innerHeight); - this.getCollectionTypes(); - - // this.cardFilter.setFilter(""); - // this.cardFilter.getCollection(); - - setInterval(() => { if (that.deckValidationDirty) { that.deckValidationDirty = false; @@ -413,15 +407,18 @@ var GempLotrDeckBuildingUI = Class.extend({ this.comm.getCollectionTypes( function (xml) { var root = xml.documentElement; - if (root.tagName == "collections") { - var collections = root.getElementsByTagName("collection"); - $("#formatSelect").append(""); - for (var i = 0; i < collections.length; i++) { - var collection = collections[i]; - $("#collectionSelect").append(""); - $("#formatSelect").append(""); - } + if (root.tagName != "collections") + return; + + var collections = root.getElementsByTagName("collection"); + $("#formatSelect").append(""); + for (var i = 0; i < collections.length; i++) { + var collection = collections[i]; + $("#collectionSelect").append(""); + $("#formatSelect").append(""); } + + $("#collectionSelect").val("default"); }); }, @@ -1029,45 +1026,49 @@ var GempLotrDeckBuildingUI = Class.extend({ var that = this; var currentFormat = $("#formatSelect").val(); - this.comm.getFormats(false, - function (json) - { - that.formatSelect.empty(); - that.formats = json.Formats; - - let max = 0; - let options = {}; - for (const [code, format] of Object.entries(that.formats)) { - if(!format.hall) - continue; - - var option = $("