Added toast for unable to find map owner

This commit is contained in:
Mitchell McCaffrey
2021-04-01 10:55:45 +11:00
parent a5d14c0fa4
commit fb1fdc430b
2 changed files with 9 additions and 0 deletions
+5
View File
@@ -1,4 +1,5 @@
import React, { useState, useEffect, useRef } from "react";
import { useToasts } from "react-toast-notifications";
import { useTokenData } from "../contexts/TokenDataContext";
import { useMapData } from "../contexts/MapDataContext";
@@ -35,6 +36,7 @@ const defaultMapActions = {
* @param {NetworkedMapProps} props
*/
function NetworkedMapAndTokens({ session }) {
const { addToast } = useToasts();
const { userId } = useAuth();
const partyState = useParty();
const {
@@ -143,6 +145,9 @@ function NetworkedMapAndTokens({ session }) {
(player) => player.userId === asset.owner
);
if (!owner) {
if (asset.type === "map") {
addToast("Unable to find owner for map");
}
continue;
}