Skip to content

Commit

Permalink
Update startedAt when the first annotation is made
Browse files Browse the repository at this point in the history
  • Loading branch information
eatyourgreens committed Nov 7, 2024
1 parent f5d0e07 commit 616ece1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/lib-classifier/src/store/ClassificationStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ const ClassificationStore = types

if (validClassificationReference) {
const classification = self.active
if (classification?.annotations.size === 0) {
// update startedAt if we're starting a new classification
classification.metadata.startedAt = (new Date()).toISOString()
}
if (classification) {
return classification.addAnnotation(task, annotationValue)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ describe('Model > ClassificationStore', function () {

classifications = rootStore.classifications
classifications.setOnComplete(snapshot => {
console.log(snapshot)
submittedClassification = snapshot
})
const taskSnapshot = Object.assign({}, singleChoiceTaskSnapshot, { taskKey: singleChoiceAnnotationSnapshot.task })
Expand Down

0 comments on commit 616ece1

Please sign in to comment.