From cf1c5085d1b1dd0515a00c2ba45124dc1a9e06ee Mon Sep 17 00:00:00 2001 From: Til Schneider Date: Tue, 11 Aug 2020 16:09:51 +0200 Subject: [PATCH] Fix geometries detection in preset_fields.js `renderDisclosureContent` in `preset_fields.js` tries to detect the geometry types of the selected entities, but the result is always `[]`. Reason: The handler of `_entityIDs.reduce` always returns `true`. So the result of the `reduce` call is `true` as well. `Object.keys(true)` results in `[]`. Fix: The handler of `_entityIDs.reduce` should return the map which collects the geometry types, so `geometries` will be be something like `["line", "vertex"]`. --- modules/ui/sections/preset_fields.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ui/sections/preset_fields.js b/modules/ui/sections/preset_fields.js index 5e8fb2910..a8061e22f 100644 --- a/modules/ui/sections/preset_fields.js +++ b/modules/ui/sections/preset_fields.js @@ -34,7 +34,8 @@ export function uiSectionPresetFields(context) { var graph = context.graph(); var geometries = Object.keys(_entityIDs.reduce(function(geoms, entityID) { - return geoms[graph.entity(entityID).geometry(graph)] = true; + geoms[graph.entity(entityID).geometry(graph)] = true; + return geoms; }, {})); var presetsManager = presetManager;