From b5bb18235ffe90d6797bf672020558dba33ec5f9 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Tue, 29 Apr 2025 21:18:40 +0200 Subject: [PATCH] fix: auto-update - ensure 1 group is default --- modules/dynamic/auto-update.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/dynamic/auto-update.js b/modules/dynamic/auto-update.js index b8e54fb0..e975623b 100644 --- a/modules/dynamic/auto-update.js +++ b/modules/dynamic/auto-update.js @@ -986,7 +986,8 @@ export function resolveVersionConflicts(mapVersion) { burgIcons.selectAll("g").each(function (_el, index) { const name = this.id; - options.burgs.groups.push({name, active: true, order: index + 1, preview: "watabou-city"}); + const isDefault = name === "towns"; + options.burgs.groups.push({name, active: true, order: index + 1, isDefault, preview: "watabou-city"}); const size = Number(this.getAttribute("size") || 2) * 2; this.removeAttribute("size"); @@ -995,6 +996,14 @@ export function resolveVersionConflicts(mapVersion) { this.setAttribute("stroke-width", 10); }); + if (!options.burgs.groups.length) { + options.burgs.groups = Burgs.getDefaultGroups(); + } + + if (options.burgs.groups.filter(g => g.isDefault).length === 0) { + options.burgs.groups[0].isDefault = true; + } + anchors.selectAll("g").each(function () { const size = Number(this.getAttribute("size") || 1); this.removeAttribute("size");