Skip to content

Commit

Permalink
Fix applied value
Browse files Browse the repository at this point in the history
  • Loading branch information
rtexelm committed Mar 25, 2024
1 parent a30cc7c commit e448a3e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ class AnnotationLayer extends React.PureComponent {
}

applyAnnotation() {
const { value } = this.state;
const { value, sourceType } = this.state;
if (this.isValidForm()) {
const annotationFields = [
'name',
Expand All @@ -536,8 +536,9 @@ class AnnotationLayer extends React.PureComponent {
}
});

// Set value to id of annotation for use in runAnnotationQuery()
newAnnotation.value = value.value;
// Prepare newAnnotation.value for use in runAnnotationQuery()
const applicableValue = requiresQuery(sourceType) ? value.value : value;
newAnnotation.value = applicableValue;

if (newAnnotation.color === AUTOMATIC_COLOR) {
newAnnotation.color = null;
Expand Down

0 comments on commit e448a3e

Please sign in to comment.