Fix unable to find owner toast appearing if map is cached

This commit is contained in:
Mitchell McCaffrey 2021-04-15 21:49:18 +10:00
parent 014cd553d1
commit 3577938501

View File

@ -144,10 +144,15 @@ function NetworkedMapAndTokens({ session }) {
const owner = Object.values(partyState).find( const owner = Object.values(partyState).find(
(player) => player.userId === asset.owner (player) => player.userId === asset.owner
); );
if (!owner) { if (!owner) {
// Add no owner toast if asset is a map and we don't have it in out cache
if (asset.type === "map") { if (asset.type === "map") {
const cachedMap = await getMapFromDB(asset.id);
if (!cachedMap) {
addToast("Unable to find owner for map"); addToast("Unable to find owner for map");
} }
}
continue; continue;
} }