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,9 +144,14 @@ function NetworkedMapAndTokens({ session }) {
const owner = Object.values(partyState).find(
(player) => player.userId === asset.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") {
addToast("Unable to find owner for map");
const cachedMap = await getMapFromDB(asset.id);
if (!cachedMap) {
addToast("Unable to find owner for map");
}
}
continue;
}