Added loading spinner to map loading

This commit is contained in:
Mitchell McCaffrey
2020-07-17 16:19:59 +10:00
parent e974c19bc4
commit 249d1d2492
2 changed files with 11 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import Modal from "../components/Modal";
import MapTiles from "../components/map/MapTiles";
import MapSettings from "../components/map/MapSettings";
import ImageDrop from "../components/ImageDrop";
import LoadingOverlay from "../components/LoadingOverlay";
import blobToBuffer from "../helpers/blobToBuffer";
@@ -195,6 +196,9 @@ function SelectMapModal({
}
async function handleDone() {
if (imageLoading) {
return;
}
if (selectedMapId) {
await applyMapChanges();
onMapChange(selectedMapWithChanges, selectedMapStateWithChanges);
@@ -287,6 +291,7 @@ function SelectMapModal({
</Button>
</Flex>
</ImageDrop>
{imageLoading && <LoadingOverlay bg="overlay" />}
</Modal>
);
}