Skip to content

Commit

Permalink
Merge branch 'master' of github.com:l3p-cv/lost
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeger-j committed Jul 10, 2023
2 parents 27ea525 + beeda4c commit d4fc117
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions frontend/lost/src/containers/Annotation/MIA/Control.js
Expand Up @@ -39,6 +39,7 @@ class Control extends Component {
dropdownOpen: false,
value: '',
loading: true,
newProposedLbl: true,
}

this.handleAddLabel = this.handleAddLabel.bind(this)
Expand Down Expand Up @@ -80,7 +81,7 @@ class Control extends Component {
this.props.maxAmount,
)
this.props.setMiaSelectedLabel(undefined)
this.setState({ value: '' })
this.setState({ value: '', newProposedLbl:true })
}

handleZoomIn() {
Expand Down Expand Up @@ -115,14 +116,21 @@ class Control extends Component {
this.props.setMiaSelectedLabel(undefined)
}

componentDidUpdate() {
if (!this.props.selectedLabel) {
if (this.props.proposedLabel) {
this.handleAddLabel(
this.props.labels.find(
(value) => value.id === this.props.proposedLabel,
),
)
componentDidUpdate(prevProps) {
console.log('proposedLabel on every update', this.props.proposedLabel)
if (this.props.proposedLabel) {
console.log('selectedLabel', this.props.selectedLabel)
if (this.state.newProposedLbl){
if (prevProps.images !== this.props.images) {
// if (prevProps.proposedLabel !== this.props.proposedLabel) {
console.log('proposedLabel', this.props.proposedLabel)
this.handleAddLabel(
this.props.labels.find(
(value) => value.id === this.props.proposedLabel,
),
)
this.setState({newProposedLbl: false})
}
}
}
}
Expand Down

0 comments on commit d4fc117

Please sign in to comment.