zone editor - add type check on load

This commit is contained in:
Azgaar 2022-02-07 00:24:34 +03:00
parent 2c269d5d2c
commit ab5cb82390

View file

@ -940,10 +940,12 @@ function parseLoadedData(data) {
if (version < 1.73) { if (version < 1.73) {
// v1.73 moved the hatching patterns out of the user's SVG // v1.73 moved the hatching patterns out of the user's SVG
document.getElementById("hatching")?.remove(); document.getElementById("hatching")?.remove();
}
if (version < 1.731) { // v1.73 added zone type to UI, ensure type is populated
// v1.731 added type to zones const zones = Array.from(document.querySelectorAll("#zones > g"));
zones.forEach(zone => {
if (!zone.dataset.type) zone.dataset.type = "Unknown";
});
} }
})(); })();