Disabled map select when loading a map
This commit is contained in:
@@ -32,6 +32,7 @@ function Map({
|
||||
onFogDrawRedo,
|
||||
allowMapDrawing,
|
||||
allowFogDrawing,
|
||||
allowMapChange,
|
||||
disabledTokens,
|
||||
}) {
|
||||
const { tokensById } = useContext(TokenDataContext);
|
||||
@@ -141,6 +142,9 @@ function Map({
|
||||
if (!allowFogDrawing) {
|
||||
disabledControls.push("fog");
|
||||
}
|
||||
if (!allowMapChange) {
|
||||
disabledControls.push("map");
|
||||
}
|
||||
|
||||
const disabledSettings = { fog: [], drawing: [] };
|
||||
if (mapShapes.length === 0) {
|
||||
|
||||
@@ -67,6 +67,7 @@ function MapContols({
|
||||
onMapStateChange={onMapStateChange}
|
||||
currentMap={currentMap}
|
||||
currentMapState={currentMapState}
|
||||
disabled={disabledControls.includes("map")}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
||||
@@ -11,6 +11,7 @@ function SelectMapButton({
|
||||
onMapStateChange,
|
||||
currentMap,
|
||||
currentMapState,
|
||||
disabled,
|
||||
}) {
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
|
||||
@@ -30,6 +31,7 @@ function SelectMapButton({
|
||||
aria-label="Select Map"
|
||||
title="Select Map"
|
||||
onClick={openModal}
|
||||
disabled={disabled}
|
||||
>
|
||||
<SelectMapIcon />
|
||||
</IconButton>
|
||||
|
||||
Reference in New Issue
Block a user