Skip to content

Commit

Permalink
fix: sync selected feature with layer api on reearth/core (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
keiya01 committed Mar 23, 2023
1 parent 6b233f1 commit ded6b0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/Map/Layers/hooks.ts
Expand Up @@ -703,7 +703,7 @@ function useSelection({
useEffect(() => {
setSelectedLayer(s =>
s[0]?.layerId && flattenedLayers?.find(l => l.id === s[0]?.layerId)
? [{ ...s[0] }, s[1], undefined] // Force update when flattenedLayers are updated
? [{ ...s[0] }, s[1], s[2]] // Force update when flattenedLayers are updated
: !s[0]?.layerId && !s[1]
? s
: [undefined, undefined, undefined],
Expand Down

0 comments on commit ded6b0b

Please sign in to comment.