Fix custom token loading for players

This commit is contained in:
Mitchell McCaffrey
2021-06-06 11:03:07 +10:00
parent 9d9fd5b753
commit 7d1cff7358
2 changed files with 6 additions and 5 deletions
+4 -4
View File
@@ -91,15 +91,15 @@ function NetworkedMapAndTokens({ session }) {
function addAssetsIfNeeded(assets) {
setAssetManifest((prevManifest) => {
if (prevManifest?.assets) {
let newManifset = { ...prevManifest };
let newAssets = { ...prevManifest.assets };
for (let asset of assets) {
const id = asset.id;
const exists = id in prevManifest.assets;
const exists = id in newAssets;
if (!exists) {
newManifset[id] = asset;
newAssets[id] = asset;
}
}
return newManifset;
return { ...prevManifest, assets: newAssets };
}
return prevManifest;
});