File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
web/libs/datamanager/src/sdk Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -740,6 +740,8 @@ export class LSFWrapper {
740
740
} ;
741
741
742
742
onSubmitDraft = async ( studio , annotation , params = { } ) => {
743
+ // It should be preserved as soon as possible because each `await` will allow it to be changed
744
+ const taskId = this . task . id ;
743
745
const annotationDoesntExist = ! annotation . pk ;
744
746
const data = { body : this . prepareData ( annotation , { isNewDraft : true } ) } ; // serializedAnnotation
745
747
const hasChanges = this . needsDraftSave ( annotation ) ;
@@ -762,11 +764,11 @@ export class LSFWrapper {
762
764
let response ;
763
765
764
766
if ( annotationDoesntExist ) {
765
- response = await this . datamanager . apiCall ( "createDraftForTask" , { taskID : this . task . id } , data ) ;
767
+ response = await this . datamanager . apiCall ( "createDraftForTask" , { taskID : taskId } , data ) ;
766
768
} else {
767
769
response = await this . datamanager . apiCall (
768
770
"createDraftForAnnotation" ,
769
- { taskID : this . task . id , annotationID : annotation . pk } ,
771
+ { taskID : taskId , annotationID : annotation . pk } ,
770
772
data ,
771
773
) ;
772
774
}
You can’t perform that action at this time.
0 commit comments