From d83c6e80fb57eb2668ecfbe18746b0eaa9e6dd5a Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Fri, 17 Jul 2020 15:02:21 +1000 Subject: [PATCH] Fix bug with sending low resolution maps --- src/components/map/MapTile.js | 7 +++++-- src/network/NetworkedMapAndTokens.js | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/map/MapTile.js b/src/components/map/MapTile.js index 42aa276..6e76a37 100644 --- a/src/components/map/MapTile.js +++ b/src/components/map/MapTile.js @@ -19,9 +19,12 @@ function MapTile({ }) { const [isMapTileMenuOpen, setIsTileMenuOpen] = useState(false); const isDefault = map.type === "default"; - const mapSource = useDataSource( - isDefault ? map : map.resolutions.low ? map.resolutions.low : map, + isDefault + ? map + : map.resolutions && map.resolutions.low + ? map.resolutions.low + : map, defaultMapSources, unknownSource ); diff --git a/src/network/NetworkedMapAndTokens.js b/src/network/NetworkedMapAndTokens.js index e705dc6..2085964 100644 --- a/src/network/NetworkedMapAndTokens.js +++ b/src/network/NetworkedMapAndTokens.js @@ -269,7 +269,11 @@ function NetworkedMapAndTokens({ session }) { replyWithFile(map.resolutions.ultra.file); break; case "original": - replyWithFile(map.resolutions.medium.file); + if (map.resolutions.medium) { + replyWithFile(map.resolutions.medium.file); + } else if (map.resolutions.low) { + replyWithFile(map.resolutions.low.file); + } replyWithFile(map.file); break; default: