AW-1079 Only add one item to overlay.
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good

This commit is contained in:
Peter (extern) 2020-03-26 10:38:39 +01:00
parent d883553934
commit 9c16681b58

View File

@ -316,6 +316,7 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
let itemLayers = state.overlayLayers.slice(0);
let itemLayer = new ItemLayer(a.item);
itemLayer.layerIndex = a.layerIndex == -1 ? 0 : a.layerIndex;
itemLayers = itemLayers.filter(item => item.layerIndex !== itemLayer.layerIndex);
itemLayers.push(itemLayer);
return tassign(state, { overlayLayers: itemLayers, selectedOverlayLayer: itemLayer });
}