From b2b6f281a95875fd6726bc4fdb1f05299a6e45e1 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Wed, 20 Jan 2021 18:55:42 +1100 Subject: [PATCH] Fix map grid detection --- src/modals/SelectMapModal.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modals/SelectMapModal.js b/src/modals/SelectMapModal.js index 6e988ac..2236bc5 100644 --- a/src/modals/SelectMapModal.js +++ b/src/modals/SelectMapModal.js @@ -127,7 +127,7 @@ function SelectMapModal({ return new Promise((resolve, reject) => { image.onload = async function () { // Find name and grid size - let gridSize = { x: 22, y: 22 }; + let gridSize; let name = "Unknown Map"; if (file.name) { if (file.name.matchAll) { @@ -162,6 +162,10 @@ function SelectMapModal({ name = Case.capital(name); } + if (!gridSize) { + gridSize = { x: 22, y: 22 }; + } + // Create resolutions const resolutions = {}; for (let resolution of mapResolutions) {