diff --git a/src/components/map/MapEditBar.js b/src/components/map/MapEditBar.js
index 0b5bb10..c1ec6a4 100644
--- a/src/components/map/MapEditBar.js
+++ b/src/components/map/MapEditBar.js
@@ -16,7 +16,6 @@ import shortcuts from "../../shortcuts";
function MapEditBar({ currentMap, disabled, onMapChange, onMapReset, onLoad }) {
const [hasMapState, setHasMapState] = useState(false);
- const [hasSelectedDefaultMap, setHasSelectedDefaultMap] = useState(false);
const { maps, mapStates, removeMaps, resetMap } = useMapData();
@@ -24,17 +23,12 @@ function MapEditBar({ currentMap, disabled, onMapChange, onMapReset, onLoad }) {
useEffect(() => {
const selectedGroups = groupsFromIds(selectedGroupIds, activeGroups);
- const selectedMaps = itemsFromGroups(selectedGroups, maps);
const selectedMapStates = itemsFromGroups(
selectedGroups,
mapStates,
"mapId"
);
- setHasSelectedDefaultMap(
- selectedMaps.some((map) => map.type === "default")
- );
-
let _hasMapState = false;
for (let state of selectedMapStates) {
if (
@@ -49,7 +43,7 @@ function MapEditBar({ currentMap, disabled, onMapChange, onMapReset, onLoad }) {
}
setHasMapState(_hasMapState);
- }, [selectedGroupIds, maps, mapStates, activeGroups]);
+ }, [selectedGroupIds, mapStates, activeGroups]);
function getSelectedMaps() {
const selectedGroups = groupsFromIds(selectedGroupIds, activeGroups);
@@ -96,11 +90,7 @@ function MapEditBar({ currentMap, disabled, onMapChange, onMapReset, onLoad }) {
}
if (shortcuts.delete(event)) {
const selectedMaps = getSelectedMaps();
- // Selected maps and none are default
- if (
- selectedMaps.length > 0 &&
- !selectedMaps.some((map) => map.type === "default")
- ) {
+ if (selectedMaps.length > 0) {
setIsMapsResetModalOpen(false);
setIsMapsRemoveModalOpen(true);
}
@@ -142,7 +132,6 @@ function MapEditBar({ currentMap, disabled, onMapChange, onMapReset, onLoad }) {
aria-label="Remove Selected Map(s)"
title="Remove Selected Map(s)"
onClick={() => setIsMapsRemoveModalOpen(true)}
- disabled={hasSelectedDefaultMap}
>
diff --git a/src/components/token/TokenEditBar.js b/src/components/token/TokenEditBar.js
index a2cafe7..a759739 100644
--- a/src/components/token/TokenEditBar.js
+++ b/src/components/token/TokenEditBar.js
@@ -20,16 +20,12 @@ function TokenEditBar({ disabled, onLoad }) {
const { activeGroups, selectedGroupIds, onGroupSelect } = useGroup();
- const [hasSelectedDefaultToken, setHasSelectedDefaultToken] = useState(false);
const [allTokensVisible, setAllTokensVisisble] = useState(false);
useEffect(() => {
const selectedGroups = groupsFromIds(selectedGroupIds, activeGroups);
const selectedTokens = itemsFromGroups(selectedGroups, tokens);
- setHasSelectedDefaultToken(
- selectedTokens.some((token) => token.type === "default")
- );
setAllTokensVisisble(selectedTokens.every((token) => !token.hideInSidebar));
}, [selectedGroupIds, tokens, activeGroups]);
@@ -64,11 +60,7 @@ function TokenEditBar({ disabled, onLoad }) {
}
if (shortcuts.delete(event)) {
const selectedTokens = getSelectedTokens();
- // Selected tokens and none are default
- if (
- selectedTokens.length > 0 &&
- !selectedTokens.some((token) => token.type === "default")
- ) {
+ if (selectedTokens.length > 0) {
// Ensure all other modals are closed
setIsTokensRemoveModalOpen(true);
}
@@ -116,7 +108,6 @@ function TokenEditBar({ disabled, onLoad }) {
aria-label="Remove Selected Token(s)"
title="Remove Selected Token(s)"
onClick={() => handleTokensRemove()}
- disabled={hasSelectedDefaultToken}
>