Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ const Classification = types
self.annotations.forEach(annotation => {
annotations = annotations.concat(annotation.toSnapshot())
})
snapshot = Object.assign({}, snapshot, { annotations })
return snapshot
return { ...snapshot, annotations }
},

// Use this to retrieve previous drawing or transcription task annotations.
Expand All @@ -38,7 +37,7 @@ const Classification = types
}
}))
.preProcessSnapshot(snapshot => {
let newSnapshot = Object.assign({}, snapshot)
let newSnapshot = { ...snapshot }
// generate classification IDs, if not present
newSnapshot.id = snapshot.id || cuid()
// convert any annotations arrays to a map
Expand All @@ -53,7 +52,7 @@ const Classification = types
return newSnapshot
})
.postProcessSnapshot(snapshot => {
const newSnapshot = Object.assign({}, snapshot)
const newSnapshot = { ...snapshot }
// convert annotations to an array
newSnapshot.annotations = Object.values(snapshot.annotations)
return newSnapshot
Expand Down
Loading