diff --git a/client/src/components/LayerManager.vue b/client/src/components/LayerManager.vue index af9d961dd..c3cefa5c8 100644 --- a/client/src/components/LayerManager.vue +++ b/client/src/components/LayerManager.vue @@ -171,7 +171,8 @@ export default defineComponent({ editingTracks.push(trackFrame); } if (editingTracks.length) { - if (editingTrack && !editAnnotationLayer.creationIncomplete()) { + if (editingTrack) { + editAnnotationLayer.checkCreationIncomplete(editingTrack, selectedKey); editAnnotationLayer.setType(editingTrack); editAnnotationLayer.setKey(selectedKey); editAnnotationLayer.changeData(editingTracks); diff --git a/client/src/layers/EditAnnotationLayer.ts b/client/src/layers/EditAnnotationLayer.ts index c0408177c..e0ea6064c 100644 --- a/client/src/layers/EditAnnotationLayer.ts +++ b/client/src/layers/EditAnnotationLayer.ts @@ -253,9 +253,13 @@ export default class EditAnnotationLayer extends BaseLayer { * Provides an indicator that the system is still waiting for creation * geoJSON data. This is relevant which switching focus while in creation mode */ - creationIncomplete(): boolean { + checkCreationIncomplete(editingType: EditAnnotationTypes, key: string) { + if (editingType !== this.type || key !== this.selectedKey) { + this.skipNextExternalUpdate = false; + return; + } const features = this.featureLayer.annotations(); - return this.getMode() === 'creation' + this.skipNextExternalUpdate = this.getMode() === 'creation' && (!features.length || (features[0] && !features[0].coordinates().length)); }