diff --git a/src/components/map/MapSettings.js b/src/components/map/MapSettings.js index e5526a7..6e12cff 100644 --- a/src/components/map/MapSettings.js +++ b/src/components/map/MapSettings.js @@ -102,7 +102,7 @@ function MapSettings({ @@ -154,8 +154,9 @@ function MapSettings({ key={quality.id} value={quality.id} disabled={ - quality.id !== "original" && - !map.resolutions[quality.id] + mapEmpty || + (quality.id !== "original" && + !map.resolutions[quality.id]) } > {quality.name} diff --git a/src/modals/SelectMapModal.js b/src/modals/SelectMapModal.js index 712cc27..949717f 100644 --- a/src/modals/SelectMapModal.js +++ b/src/modals/SelectMapModal.js @@ -174,9 +174,9 @@ function SelectMapModal({ async function handleMapRemove(id) { await removeMap(id); - setSelectedMapId(null); setMapSettingChanges({}); setMapStateSettingChanges({}); + setSelectedMapId(null); // Removed the map from the map screen if needed if (currentMap && currentMap.id === selectedMapId) { onMapChange(null, null); @@ -265,8 +265,11 @@ function SelectMapModal({ } } - const selectedMapWithChanges = { ...selectedMap, ...mapSettingChanges }; - const selectedMapStateWithChanges = { + const selectedMapWithChanges = selectedMap && { + ...selectedMap, + ...mapSettingChanges, + }; + const selectedMapStateWithChanges = selectedMapState && { ...selectedMapState, ...mapStateSettingChanges, };