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

Commit 2d2d044

Browse files
authored
fix: LSDV-5262: Save draft on postpone (#1447)
1 parent 64c2db4 commit 2d2d044

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/stores/Annotation/Annotation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ export const Annotation = types
664664
onSnapshot(self.areas, self.autosave);
665665
}),
666666

667-
saveDraft() {
667+
saveDraft(params) {
668668
// if this is now a history item or prediction don't save it
669669
if (!self.editable) return;
670670

@@ -677,7 +677,7 @@ export const Annotation = types
677677
self.versions.draft = result;
678678
self.setDraftSaving(true);
679679

680-
self.store.submitDraft(self).then(self.onDraftSaved);
680+
return self.store.submitDraft(self, params).then(self.onDraftSaved);
681681
},
682682

683683
saveDraftImmediately() {

src/stores/AppStore.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -726,12 +726,9 @@ export default types
726726
async function postponeTask() {
727727
const annotation = self.annotationStore.selected;
728728

729-
if (!annotation.versions.draft) {
730-
// annotation created from prediction, so no draft was created
731-
annotation.versions.draft = annotation.versions.result;
732-
}
733-
734-
await self.submitDraft(annotation, { was_postponed: true });
729+
// save draft before postponing; this can be new draft with FF_DEV_4174 off
730+
// or annotation created from prediction
731+
await annotation.saveDraft({ was_postponed: true });
735732
await getEnv(self).events.invoke('nextTask');
736733
}
737734

0 commit comments

Comments
 (0)