Removed strict null check from map and mapState

This commit is contained in:
Mitchell McCaffrey 2021-01-23 00:01:15 +11:00
parent cee3514e71
commit 493377233c

View File

@ -428,19 +428,19 @@ function NetworkedMapAndTokens({ session }) {
const canChangeMap = !isLoading; const canChangeMap = !isLoading;
const canEditMapDrawing = const canEditMapDrawing =
currentMap !== null && currentMap &&
currentMapState !== null && currentMapState &&
(currentMapState.editFlags.includes("drawing") || (currentMapState.editFlags.includes("drawing") ||
currentMap.owner === userId); currentMap.owner === userId);
const canEditFogDrawing = const canEditFogDrawing =
currentMap !== null && currentMap &&
currentMapState !== null && currentMapState &&
(currentMapState.editFlags.includes("fog") || currentMap.owner === userId); (currentMapState.editFlags.includes("fog") || currentMap.owner === userId);
const canEditNotes = const canEditNotes =
currentMap !== null && currentMap &&
currentMapState !== null && currentMapState &&
(currentMapState.editFlags.includes("notes") || (currentMapState.editFlags.includes("notes") ||
currentMap.owner === userId); currentMap.owner === userId);
@ -448,8 +448,8 @@ function NetworkedMapAndTokens({ session }) {
// If we have a map and state and have the token permission disabled // If we have a map and state and have the token permission disabled
// and are not the map owner // and are not the map owner
if ( if (
currentMapState !== null && currentMapState &&
currentMap !== null && currentMap &&
!currentMapState.editFlags.includes("tokens") && !currentMapState.editFlags.includes("tokens") &&
currentMap.owner !== userId currentMap.owner !== userId
) { ) {