Added back state restoration on map modal open
This commit is contained in:
parent
11671849f8
commit
05a13acf8b
@ -89,12 +89,20 @@ function SelectMapModal({
|
||||
const defaultMapsWithIds = await getDefaultMaps();
|
||||
const allMaps = [...sortedMaps, ...defaultMapsWithIds];
|
||||
setMaps(allMaps);
|
||||
|
||||
// reload map state as is may have changed while the modal was closed
|
||||
if (selectedMap) {
|
||||
const state = await db.table("states").get(selectedMap.id);
|
||||
if (state) {
|
||||
setSelectedMapState(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!wasOpen && isOpen) {
|
||||
loadMaps();
|
||||
}
|
||||
}, [userId, isOpen, wasOpen]);
|
||||
}, [userId, isOpen, wasOpen, selectedMap]);
|
||||
|
||||
const fileInputRef = useRef();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user