From 357793850167f520f5d68fb9546df56ab77b5048 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Thu, 15 Apr 2021 21:49:18 +1000 Subject: [PATCH] Fix unable to find owner toast appearing if map is cached --- src/network/NetworkedMapAndTokens.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/network/NetworkedMapAndTokens.js b/src/network/NetworkedMapAndTokens.js index 45f6967..68e1b59 100644 --- a/src/network/NetworkedMapAndTokens.js +++ b/src/network/NetworkedMapAndTokens.js @@ -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; }