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

View File

@ -31,3 +31,7 @@ We encourage users to create games every 24hrs. Any maps you have added or made
### I can join my game but the spinner is constantly loading, why? ### I can join my game but the spinner is constantly loading, why?
This could mean that the service is currently down. Please visit us on Twitter or Reddit and let us know. This could mean that the service is currently down. Please visit us on Twitter or Reddit and let us know.
### Unable to find owner for map?
If you see a message labelled "Unable to find owner for map" please ensure that the owner of the map is connected to the game. If they are, they may need to refresh their browser to reconnect.

View File

@ -1,4 +1,5 @@
import React, { useState, useEffect, useRef } from "react"; import React, { useState, useEffect, useRef } from "react";
import { useToasts } from "react-toast-notifications";
import { useTokenData } from "../contexts/TokenDataContext"; import { useTokenData } from "../contexts/TokenDataContext";
import { useMapData } from "../contexts/MapDataContext"; import { useMapData } from "../contexts/MapDataContext";
@ -35,6 +36,7 @@ const defaultMapActions = {
* @param {NetworkedMapProps} props * @param {NetworkedMapProps} props
*/ */
function NetworkedMapAndTokens({ session }) { function NetworkedMapAndTokens({ session }) {
const { addToast } = useToasts();
const { userId } = useAuth(); const { userId } = useAuth();
const partyState = useParty(); const partyState = useParty();
const { const {
@ -143,6 +145,9 @@ function NetworkedMapAndTokens({ session }) {
(player) => player.userId === asset.owner (player) => player.userId === asset.owner
); );
if (!owner) { if (!owner) {
if (asset.type === "map") {
addToast("Unable to find owner for map");
}
continue; continue;
} }