Fixed 2 bugs with map loading and sending
When a map was sent the receiver didn't save the resolutions tihs meant that if the original map owner left or wasn't the party leader the map would be blank when new users joined. Also if a map sender left when sending a map and rejoined their version of the map would be overriden by a corrupted version.
This commit is contained in:
@@ -147,6 +147,10 @@ export function MapDataProvider({ children }) {
|
||||
return maps.find((map) => map.id === mapId);
|
||||
}
|
||||
|
||||
async function getMapFromDB(mapId) {
|
||||
return await database.table("maps").get(mapId);
|
||||
}
|
||||
|
||||
const ownedMaps = maps.filter((map) => map.owner === userId);
|
||||
|
||||
const value = {
|
||||
@@ -160,6 +164,7 @@ export function MapDataProvider({ children }) {
|
||||
updateMapState,
|
||||
putMap,
|
||||
getMap,
|
||||
getMapFromDB,
|
||||
};
|
||||
return (
|
||||
<MapDataContext.Provider value={value}>{children}</MapDataContext.Provider>
|
||||
|
||||
Reference in New Issue
Block a user