Send a map clear before replace to ensure new state isn't show on old image

This commit is contained in:
Mitchell McCaffrey
2020-04-24 16:18:48 +10:00
parent db8e0c14fb
commit a4e1a898ad
3 changed files with 26 additions and 19 deletions

View File

@@ -141,7 +141,7 @@ function SelectMapModal({
});
// Removed the map from the map screen if needed
if (currentMap && currentMap.id === selectedMap.id) {
onMapChange(null);
onMapChange(null, null);
}
}
@@ -165,8 +165,7 @@ function SelectMapModal({
if (selectedMap) {
let currentMapState =
(await db.table("states").get(selectedMap.id)) || defaultMapState;
onMapStateChange(currentMapState);
onMapChange(selectedMap);
onMapChange(selectedMap, currentMapState);
onDone();
}
onDone();