From ab5cb823909da9f738b83c288fe65501597ca4a8 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Mon, 7 Feb 2022 00:24:34 +0300 Subject: [PATCH] zone editor - add type check on load --- modules/load.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/load.js b/modules/load.js index d358f15d..a8893592 100644 --- a/modules/load.js +++ b/modules/load.js @@ -940,10 +940,12 @@ function parseLoadedData(data) { if (version < 1.73) { // v1.73 moved the hatching patterns out of the user's SVG document.getElementById("hatching")?.remove(); - } - if (version < 1.731) { - // v1.731 added type to zones + // v1.73 added zone type to UI, ensure type is populated + const zones = Array.from(document.querySelectorAll("#zones > g")); + zones.forEach(zone => { + if (!zone.dataset.type) zone.dataset.type = "Unknown"; + }); } })();