diff --git a/frontend/src/components/maps/LocationMapBottomSheet.jsx b/frontend/src/components/maps/LocationMapBottomSheet.jsx index da3897e..05cfb7a 100644 --- a/frontend/src/components/maps/LocationMapBottomSheet.jsx +++ b/frontend/src/components/maps/LocationMapBottomSheet.jsx @@ -94,6 +94,8 @@ export default function LocationMapBottomSheet({ const visibleAreaCount = filters.showZones ? Math.max(0, totalAreaCount - hiddenAreaCount) : 0; + const hasNoVisibleAreas = + filters.showZones && totalAreaCount > 0 && visibleAreaCount === 0 && hiddenAreaCount > 0; const showMapOverview = mode !== "edit" && !selectedObject; const unlinkedAreaCount = useMemo( () => mapObjects.filter((object) => !objectZoneId(object)).length, @@ -109,6 +111,8 @@ export default function LocationMapBottomSheet({ const hasHiddenUnmappedItems = filters.showUnmapped && unmappedItemCount > 0 && visibleUnmappedItems.length === 0; const hiddenAreaLabel = `Show Hidden Areas (${hiddenAreaCount})`; + const showHiddenAreaAction = + showEditorControls && hiddenAreaCount > 0 && filters.showZones && !hasNoVisibleAreas; const saveDraftLabel = savingAction === "save" ? "Saving..." : "Save Draft"; const publishLabel = savingAction === "publish" ? "Publishing..." : "Publish"; const mappedItemSummary = assignedItemCount === visibleAssignedItemCount @@ -236,7 +240,7 @@ export default function LocationMapBottomSheet({ ) : editorActions} - {showEditorControls && hiddenAreaCount > 0 ? ( + {showHiddenAreaAction ? (