From 5a9a07919852cc2812ef0c9b40bfb1538d3ea222 Mon Sep 17 00:00:00 2001 From: Pjero Nizetic Date: Tue, 26 Mar 2024 16:57:18 +0100 Subject: [PATCH] Support layer labels API format --- src/common/store/response.store.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/store/response.store.js b/src/common/store/response.store.js index ee57fa4..609190d 100644 --- a/src/common/store/response.store.js +++ b/src/common/store/response.store.js @@ -162,7 +162,14 @@ export const useResponseStore = create((set, get) => ({ }); }); useLayersStore.getState().addPolygonLayers(polygonLayers); - drawing.textLayers.forEach(name => textLayerNames.add(name)); + drawing.textLayers.forEach(layer => { + // check if layer is just string or object - to support old and new format + if (layer.name) { + textLayerNames.add(layer.name); + } else { + textLayerNames.add(layer); + } + }); }); if (polygonLayerNames.size === 0) {