Skip to content

Commit 0c38d86

Browse files
committed
Remove setTimeout no longer required by adding stopClick
1 parent ae58857 commit 0c38d86

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/plugins/Gfi/src/store/actions/setupMultiSelection.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { GfiGetters, GfiState } from '../../types'
88

99
const circleDraw = new Draw({
1010
source: new VectorSource(),
11+
stopClick: true,
1112
type: 'Circle',
1213
style: new Style({
1314
stroke: new Stroke({ color: '#118bee', width: 2 }),
@@ -64,12 +65,10 @@ export function setupMultiSelection({
6465
// @ts-expect-error | A feature that is drawn has a geometry.
6566
coordinateOrExtent: e.feature.getGeometry().getExtent(),
6667
modifierPressed: true,
67-
}).finally(() =>
68-
// Needed so that no pin is set when finishing drawing the circle
69-
setTimeout(() => {
68+
}).finally(
69+
() =>
7070
// @ts-expect-error | internal hack to detect it in @polar/plugin-pins
71-
circleDraw._isMultiSelect = false
72-
}, 250)
71+
(circleDraw._isMultiSelect = false)
7372
)
7473
)
7574
map.addInteraction(circleDraw)

0 commit comments

Comments
 (0)