Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Only save drafts when regions changes
Browse files Browse the repository at this point in the history
Comments are for the next iteration
  • Loading branch information
hlomzik committed Feb 7, 2024
1 parent 735c6d6 commit 0e84bd9
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/stores/Annotation/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@ const AnnotationStoreModel = types
function toggleViewingAll() {
if (self.viewingAllAnnotations || self.viewingAllPredictions) {
if (self.selected) {
const comments = self.store.commentStore;

if (comments.currentComment) {
// comment will save draft automatically
comments.commentFormSubmit();
} else if (self.selected.type === 'annotation') {
// save draft if there are changes waiting to be saved
// const comments = self.store.commentStore;

// @todo current comment is an object and that was not a part of original fix
// @todo so leave it for later
// if (comments.currentComment) {
// // comment will save draft automatically
// comments.commentFormSubmit();
// } else
if (self.selected.type === 'annotation') {
// save draft if there are changes waiting to be saved — it's handled inside
self.selected.saveDraftImmediately();
}

Expand Down

0 comments on commit 0e84bd9

Please sign in to comment.